/**
 * 全局样式
 * 包含基础样式、布局、字体、颜色等全局设置
 */

/* ==================== 引入其他样式文件 ==================== */


/* ==================== 基础样式重置 ==================== */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #2c3e50;
  background: #f5f6f8;
  line-height: 1.6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==================== 布局系统 ==================== */
.page {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}

.main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  flex-shrink: 0;
}

.content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.content>.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  font-size: 12px;
  flex-shrink: 0;
}

/* ==================== 品牌样式 ==================== */
.brand {
  font-weight: 600;
  color: #2c3e50;
}

/* ==================== 菜单样式 ==================== */
.menu {
  padding: 0;
}

.menu a,
.menu .menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #374151;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.menu a:hover,
.menu .menu-item:hover {
  background: #f3f4f6;
}

.menu a.active,
.menu .menu-item.active {
  border-left-color: #0d6efd;
  background: #eef2ff;
  color: #007bff;
}

.menu-icon {
  margin-right: 12px;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.menu-text {
  font-size: 14px;
  font-weight: 500;
}

/* ==================== 面包屑导航 ==================== */
.breadcrumb {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.breadcrumb a {
  color: #007bff;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  border: 2px solid #fff;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ==================== 通用组件样式 ==================== */
/* 包含按钮、表单、卡片、表格、状态徽章等通用组件 */

/* ==================== 按钮组件 ==================== */
/* 基础按钮样式 - 使用CSS变量实现主题化 */
.btn {
  --btn-bg: #007bff;
  --btn-color: #fff;
  --btn-border: transparent;
  --btn-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  --btn-hover-bg: #0056b3;
  --btn-hover-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);

  display: inline-block;
  padding: 10px 16px;
  background: var(--btn-bg);
  color: var(--btn-color);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--btn-border);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--btn-shadow);
  text-align: center;
  line-height: 1.4;
}

.btn:hover {
  background: var(--btn-hover-bg);
  transform: translateY(-1px);
  box-shadow: var(--btn-hover-shadow);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* 按钮颜色变体 */
.btn-secondary {
  background: #6c757d;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
  background: #545b62;
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.btn-danger {
  background: #dc3545;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
  background: #c82333;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-success {
  background: #28a745;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.btn-success:hover {
  background: #1e7e34;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-info {
  background: #17a2b8;
  color: #fff;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.btn-info:hover {
  background: #138496;
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.btn-warning {
  background: #ffc107;
  color: #212529;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-warning:hover {
  background: #e0a800;
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

/* 按钮尺寸变体 - 可选使用 */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

/* 特殊场景按钮样式 */
.btn-login {
  width: 100%;
  padding: 10px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-login:hover {
  background: #0062cc;
}

/* ==================== 表单组件 ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fff;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-control:hover {
  border-color: #d1d5db;
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-help {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.form-check-input {
  margin-right: 8px;
  transform: scale(1.1);
}

.form-check-label {
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

/* 表单验证状态 */
.form-control.is-valid {
  border-color: #28a745;
}

.form-control.is-invalid {
  border-color: #dc3545;
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 12px;
  color: #dc3545;
}

.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 12px;
  color: #28a745;
}

/* ==================== 卡片组件 ==================== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
  background: #fafafa;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.card-body {
  padding: 16px;
}

.card-footer {
  background: #f8f9fa;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
}

/* ==================== 表格组件 ==================== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.table th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: #f8f9fa;
}

.table-responsive {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ==================== 状态徽章组件 ==================== */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease;
}

.status-badge:hover {
  transform: scale(1.02);
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-warning {
  background: #fff3cd;
  color: #856404;
}

.status-danger {
  background: #f8d7da;
  color: #721c24;
}

.status-info {
  background: #d1ecf1;
  color: #0c5460;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

/* ==================== 模态框组件 ==================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

.modal-body {
  padding: 1rem 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
}

/* ==================== 开关组件 ==================== */
.modern-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.switch-track {
  position: relative;
  width: 50px;
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  transition: all 0.3s ease;
  margin-right: 12px;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modern-switch.active .switch-track {
  background: #007bff;
}

.modern-switch.active .switch-thumb {
  transform: translateX(26px);
}

.switch-label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.modern-switch:hover .switch-track {
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.modern-switch.active:hover .switch-track {
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
}

/* ==================== 标签页组件 ==================== */
.tabs {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.tab {
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  color: #6c757d;
  text-decoration: none;
}

.tab:hover {
  background: #e9ecef;
  color: #495057;
}

.tab.active {
  background: #fff;
  border-bottom-color: #007bff;
  color: #007bff;
}

.tab-content {
  display: none;
  padding: 1.5rem;
}

.tab-content.active {
  display: block;
}

/* ==================== 统计卡片组件 ==================== */
.stat-card {
  text-align: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-card .card-body {
  text-align: center;
  padding: 24px 20px;
}

.stat-number {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1;
  font-weight: bold;
  margin-bottom: 8px;
}

.stat-label {
  margin: 0;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* ==================== 空状态组件 ==================== */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: #495057;
}

.empty-state-content {
  max-width: 600px;
  margin: 0 auto;
}

.empty-icon {
  margin-bottom: 1rem;
  font-size: 3rem;
  opacity: 0.5;
}

.empty-tips {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: left;
}

.empty-tips h5,
.empty-tips h6 {
  color: #495057;
  margin-bottom: 1rem;
  text-align: center;
}

.empty-tips ul {
  list-style: none;
  padding: 0;
}

.empty-tips li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
  position: relative;
  padding-left: 1.5rem;
}

.empty-tips li:before {
  content: "•";
  color: #007bff;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.empty-tips li:last-child {
  border-bottom: none;
}

/* ==================== 工具类 ==================== */
.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-5 {
  margin-top: 20px;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-5 {
  margin-bottom: 20px;
}

.ml-1 {
  margin-left: 4px;
}

.ml-2 {
  margin-left: 8px;
}

.ml-3 {
  margin-left: 12px;
}

.ml-4 {
  margin-left: 16px;
}

.ml-5 {
  margin-left: 20px;
}

.mr-1 {
  margin-right: 4px;
}

.mr-2 {
  margin-right: 8px;
}

.mr-3 {
  margin-right: 12px;
}

.mr-4 {
  margin-right: 16px;
}

.mr-5 {
  margin-right: 20px;
}

.p-1 {
  padding: 4px;
}

.p-2 {
  padding: 8px;
}

.p-3 {
  padding: 12px;
}

.p-4 {
  padding: 16px;
}

.p-5 {
  padding: 20px;
}

.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-inline {
  display: inline;
}

.d-inline-block {
  display: inline-block;
}

.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.w-100 {
  width: 100%;
}

.h-100 {
  height: 100%;
}

/* ==================== 响应式网格 ==================== */
.grid {
  display: grid;
  gap: 16px;
}

.grid-1 {
  grid-template-columns: 1fr;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* ==================== 表单输入框样式 ==================== */
/* 文本输入框样式 - 兼容旧样式 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"] {
  width: 100%;
  padding: 6px 6px;
  margin: 5px 0;
  box-sizing: border-box;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  font-family: Arial, sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder,
input[type="url"]::placeholder {
  color: #888;
}

/* 屏蔽部分浏览器的显示/隐藏密码 */
input::-ms-reveal {
  display: none;
}

/* Checkbox样式 */
input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: inherit;
  font-family: inherit;
  transition: none;
  box-shadow: none;
  outline: none;
  cursor: pointer;
}

input[type="checkbox"]:focus {
  border: none;
  box-shadow: none;
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Textarea样式 */
textarea {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  font-family: Arial, sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

textarea::placeholder {
  color: #888;
}

/* Select 样式 */
select.form-control {
  width: 100%;
  padding: 6px 6px;
  margin: 5px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  font-size: 16px;
  font-family: Arial, sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
}

select.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

select.form-control option {
  padding: 10px;
  font-size: 16px;
}

select.form-control option:first-child {
  color: #888;
  font-style: italic;
}

/* ==================== 特殊组件样式 ==================== */
/* Required Switch */
.required-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 16px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fff;
  transition: all 0.3s ease;
  user-select: none;
}

.required-switch:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.required-switch.active {
  border-color: #28a745;
  background: #d4edda;
}

.required-switch input[type="checkbox"] {
  display: none;
}

.required-switch input[type="checkbox"] {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  font-family: inherit !important;
  transition: none !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer !important;
}

.required-switch label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  color: #495057;
}

.required-switch.active label {
  color: #155724;
}

/* ==================== 移动端样式 ==================== */
/* 移动端样式已移至 mobile.css 文件中 */

/* ==================== 模态框样式 ==================== */
/* 模态框样式已在上面定义，避免重复 */