/*!
 * 赛事管理系统 - 统一主题样式
 * 设计理念：现代、自然、统一
 * Version: 1.0
 */

/* ============================================
   1. 设计系统变量
   ============================================ */
:root {
  /* 主色系 - 蓝色调 */
  --primary-600: #2563eb;
  --primary-500: #3b82f6;
  --primary-400: #60a5fa;
  
  /* 中性色系 */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  
  /* 功能色 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* 背景色 */
  --bg-page: #f9f9f9;
  --bg-card: #ffffff;
  
  /* 边框 */
  --border-light: #e5e7eb;
  --border-default: #d1d5db;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 8px 18px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  
  /* 间距 */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
}

/* ============================================
   2. 全局基础样式
   ============================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", 
               "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  background: var(--bg-page) !important;
  color: var(--slate-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. 页面容器样式
   ============================================ */
.wst-page {
  padding: 16px;
  background: var(--bg-page);
}

/* ============================================
   4. 卡片组件
   ============================================ */
.wst-card {
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-light);
  padding: 16px;
  margin-bottom: 12px;
}

.wst-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.wst-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-900);
}

/* ============================================
   5. 查询条件栏优化
   ============================================ */
.wst-tbar {
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wst-tbar label {
  margin: 0;
  padding: 0 4px;
  color: var(--slate-600);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}

.wst-tbar .form-control {
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  padding: 4px 10px;
  font-size: 13px;
  transition: all 0.15s ease;
  background: var(--bg-card);
}

.wst-tbar .form-control:focus {
  border-color: #4073fa;
  box-shadow: 0 0 0 2px rgba(64, 115, 250, 0.1);
  outline: none;
}

.wst-tbar input[type="text"],
.wst-tbar select {
  width: auto;
  min-width: 140px;
}

/* ============================================
   6. 按钮优化
   ============================================ */
.btn {
  height: 32px !important;
  padding: 0 12px !important;
  border-radius: 4px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  border: none !important;
  transition: all 0.15s ease;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none !important;
}

.btn-primary,
.btn-primary:focus {
  background: #4073fa !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:active {
  background: #3461db !important;
  color: #fff !important;
}

.btn-success,
.btn-success:focus {
  background: #10b981 !important;
  color: #fff !important;
}

.btn-success:hover,
.btn-success:active {
  background: #059669 !important;
  color: #fff !important;
}

.btn-danger,
.btn-danger:focus {
  background: #ef4444 !important;
  color: #fff !important;
}

.btn-danger:hover,
.btn-danger:active {
  background: #dc2626 !important;
  color: #fff !important;
}

.btn-default,
.btn-default:focus {
  background: #fff !important;
  color: #475569 !important;
  border: 1px solid #d1d5db !important;
}

.btn-default:hover,
.btn-default:active {
  background: #f8fafc !important;
  border-color: #9ca3af !important;
  color: #1e293b !important;
}

.btn-warning,
.btn-warning:focus {
  background: #f59e0b !important;
  color: #fff !important;
}

.btn-warning:hover,
.btn-warning:active {
  background: #d97706 !important;
  color: #fff !important;
}

.btn-info,
.btn-info:focus {
  background: #0ea5e9 !important;
  color: #fff !important;
}

.btn-info:hover,
.btn-info:active {
  background: #0284c7 !important;
  color: #fff !important;
}

.btn .glyphicon,
.btn .fa {
  margin-right: 2px;
  font-size: 12px;
}

/* ============================================
   7. 表格优化
   ============================================ */
.wst-body {
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.wst-list {
  margin: 0;
  border: none;
  border-radius: 0;
}

.wst-list thead {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}

.wst-list thead th {
  color: var(--slate-600);
  font-weight: 600;
  font-size: 12px;
  padding: 10px 12px;
  border: none;
  vertical-align: middle;
  white-space: nowrap;
}

.wst-list tbody tr {
  border-bottom: 1px solid var(--border-light);
}

.wst-list tbody tr:last-child {
  border-bottom: none;
}

.wst-list tbody tr:hover {
  background: #f8fafc;
}

.wst-list tbody td {
  padding: 10px 12px;
  color: var(--slate-700);
  font-size: 13px;
  vertical-align: middle;
  border: none;
}

.wst-list tbody td .btn {
  margin-right: 4px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

/* ============================================
   8. 表单优化
   ============================================ */
.wst-form {
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-light);
  margin: 0;
}

.wst-form tr {
  border-bottom: 1px solid var(--border-light);
}

.wst-form tr:last-child {
  border-bottom: none;
}

.wst-form th {
  background: #f8fafc;
  color: var(--slate-600);
  font-weight: 500;
  padding: 10px 14px;
  border: none;
  vertical-align: middle;
  width: 100px;
  text-align: right;
  font-size: 13px;
}

.wst-form td {
  padding: 10px 14px;
  border: none;
  vertical-align: middle;
}

.wst-form .form-control {
  border-radius: 4px;
  border: 1px solid var(--border-default);
  padding: 6px 10px;
  font-size: 13px;
  transition: all 0.15s ease;
  background: var(--bg-card);
  height: 32px;
}

.wst-form .form-control:focus {
  border-color: #4073fa;
  box-shadow: 0 0 0 2px rgba(64, 115, 250, 0.1);
  outline: none;
}

.wst-form textarea.form-control {
  resize: vertical;
  line-height: 1.5;
  height: auto;
  min-height: 60px;
}

.wst-form .wst-ipt {
  width: 300px;
  max-width: 100%;
}

.wst-form font[color='red'] {
  color: var(--danger);
  margin-left: 2px;
}

.wst-form label {
  margin-right: 12px;
  font-weight: normal;
  color: var(--slate-700);
  font-size: 13px;
}

.wst-form input[type="radio"],
.wst-form input[type="checkbox"] {
  margin-right: 4px;
}

/* ============================================
   9. 分页组件优化
   ============================================ */
.wst-pager {
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-light);
  padding: 10px 16px;
  margin-top: 12px;
  text-align: center;
}

.wst-pager .pagination {
  margin: 0;
}

.wst-pager .pagination > li > a,
.wst-pager .pagination > li > span {
  color: var(--slate-600);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  margin: 0 2px;
  padding: 4px 10px;
  font-size: 13px;
}

.wst-pager .pagination > li > a:hover {
  background: #e8f4ff;
  border-color: #4073fa;
  color: #4073fa;
}

.wst-pager .pagination > .active > a,
.wst-pager .pagination > .active > span {
  background: #4073fa;
  border-color: #4073fa;
  color: #fff;
}

/* ============================================
   10. 页面标题区域
   ============================================ */
.page-header-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.page-header-area h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-900);
}

.page-header-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   11. 状态标签
   ============================================ */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* ============================================
   12. 响应式优化
   ============================================ */
@media (max-width: 768px) {
  .wst-page {
    padding: var(--spacing-sm);
  }
  
  .wst-tbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .wst-tbar input[type="text"],
  .wst-tbar select {
    width: 100%;
  }
  
  .wst-form .wst-ipt {
    width: 100%;
  }
  
  .wst-list tbody td .btn {
    margin-bottom: 4px;
  }
  
  .page-header-area {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
}

/* ============================================
   13. 登录页面样式（与主题统一）
   ============================================ */
.login-page {
  background: var(--bg-page) !important;
}

.login-box-body {
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-base) !important;
  padding: 26px !important;
  background: var(--bg-card) !important;
}

.modern-input .form-control {
  height: 34px !important;
  border-radius: var(--radius-md) !important;
  border-color: var(--border-default) !important;
}

.modern-input .form-control:focus {
  border-color: var(--primary-600) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

/* ============================================
   14. 主框架页面优化
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500)) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2) !important;
}

.header .logo {
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
}

.left-side {
  background: #fff !important;
  border-right: 1px solid var(--border-light) !important;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-menu > li.treeview > a {
  color: var(--slate-800) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.sidebar-menu > li.treeview > a:hover {
  background: var(--slate-50) !important;
}

.sidebar-menu .treeview-menu > li > a {
  color: var(--slate-600) !important;
  transition: all 0.2s ease !important;
}

.sidebar-menu .treeview-menu > li > a:hover {
  background: var(--slate-50) !important;
  color: var(--primary-600) !important;
}

/* ============================================
   15. 工具类
   ============================================ */
.text-muted {
  color: var(--slate-500) !important;
}

.text-primary {
  color: var(--primary-600) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }

/* ============================================
   16. 打印页面优化（保持简洁）
   ============================================ */
@media print {
  .wst-tbar,
  .page-header-area .btn,
  .wst-list tbody td .btn {
    display: none !important;
  }
  
  .wst-card,
  .wst-body {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ============================================
   17. 辅助增强
   ============================================ */
/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 选中文本颜色 */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--slate-900);
}

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

::-webkit-scrollbar-track {
  background: var(--slate-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* 焦点可见性增强 */
*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* 禁用状态 */
.btn:disabled,
.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 加载动画 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  animation: spin 1s linear infinite;
}
