/* PC 后台端公共样式 - 所有页面引用 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5; color: #1f2937; font-size: 14px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: #4f6ef7; text-decoration: none; }
button { cursor: pointer; border: none; border-radius: 6px; font-family: inherit; }

:root {
  --primary: #4f6ef7;
  --primary-dark: #3d5ce0;
  --primary-light: #eef1ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #6b7280;
  --info-light: #f3f4f6;
  --border: #e5e7eb;
  --bg: #f0f2f5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

/* ==================== 左侧侧边栏（深色高端） ==================== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 210px;
  background: linear-gradient(180deg, #1e2642 0%, #161b2e 100%);
  display: flex; flex-direction: column; z-index: 10;
  box-shadow: 2px 0 12px rgba(0,0,0,.15);
}
.sidebar .logo {
  padding: 22px 18px; font-size: 15px; font-weight: 700;
  color: #fff; letter-spacing: .8px;
  border-bottom: 1px solid rgba(255,255,255,.08); line-height: 1.5;
}
.sidebar .logo small {
  display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.45);
  letter-spacing: 2px; margin-top: 4px;
}
.sidebar .menu { flex: 1; padding: 10px 0; overflow-y: auto; }
.sidebar .menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; margin: 0 10px; color: rgba(255,255,255,.55); font-size: 13.5px;
  border-radius: 8px; transition: .2s;
}
.sidebar .menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .menu a.active { background: linear-gradient(90deg, rgba(79,110,247,.25), rgba(79,110,247,.08)); color: #8aa4ff; font-weight: 500; }
.sidebar .menu a .icon { font-size: 16px; width: 20px; text-align: center; }

/* 二级子菜单 */
.sidebar .menu .menu-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; margin: 0 10px; color: rgba(255,255,255,.55); font-size: 13.5px;
  border-radius: 8px; transition: .2s; cursor: pointer;
}
.sidebar .menu .menu-parent:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .menu .menu-parent.open { background: linear-gradient(90deg, rgba(79,110,247,.18), rgba(79,110,247,.06)); color: #8aa4ff; font-weight: 500; }
.sidebar .menu .arrow { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.3); transition: transform .2s; }
.sidebar .menu .menu-parent.open .arrow { transform: rotate(180deg); color: #8aa4ff; }
.sidebar .menu .submenu { display: none; }
.sidebar .menu .submenu.open { display: block; }
.sidebar .menu .submenu a { padding-left: 42px; font-size: 13px; margin: 0 10px; }
.sidebar .user {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.45); font-size: 12px;
}
.sidebar .user a { color: #f87171; transition: .2s; }
.sidebar .user a:hover { color: #fca5a5; }

/* ==================== 布局 ==================== */
.container { padding: 24px; margin-left: 210px; min-height: 100vh; }
.card {
  background: #fff; border-radius: 12px; padding: 22px;
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
  border: 1px solid rgba(229,231,235,.6);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  font-size: 16px; font-weight: 600; margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border); color: #111827;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #8b5cf6);
}

/* ==================== 统计卡片（渐变高端） ==================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 22px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(229,231,235,.5);
  position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 12px 12px 0 0;
}
.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), #8b5cf6); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card .label { color: #6b7280; font-size: 13px; margin-bottom: 10px; font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #111827; letter-spacing: .3px; }
.stat-card .value.primary { color: var(--primary); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }

/* ==================== 表格（精致化） ==================== */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--border); }
th {
  background: #f9fafb; color: #374151; font-weight: 600; font-size: 13px;
  position: sticky; top: 0; z-index: 2;
}
tr:hover td { background: #f9fafb; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }

/* ==================== 按钮（渐变现代） ==================== */
.btn {
  padding: 8px 18px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 8px; font-size: 13px; font-weight: 500;
  border: none; transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: 0 4px 12px rgba(79,110,247,.22); position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 55%);
  pointer-events: none;
}
.btn:hover { opacity: .92; box-shadow: 0 6px 16px rgba(79,110,247,.3); }
.btn:active { transform: scale(.97); }
.btn-ghost {
  background: #fff; color: var(--primary); border: 1px solid #d1d5db;
  box-shadow: none;
}
.btn-ghost::after { display: none; }
.btn-ghost:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  box-shadow: 0 4px 12px rgba(16,185,129,.22);
}
.btn-success::after { background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 55%); }
.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  box-shadow: 0 4px 12px rgba(245,158,11,.22);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  box-shadow: 0 4px 12px rgba(239,68,68,.22);
}
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

/* ==================== 表单（现代输入框） ==================== */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 7px; color: #374151; font-size: 13px; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 13px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; outline: none; transition: .2s; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.1); }
.form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }

/* ==================== 标签（更柔和） ==================== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: #059669; }
.tag-warning { background: var(--warning-light); color: #b45309; }
.tag-danger { background: var(--danger-light); color: #dc2626; }
.tag-info { background: var(--info-light); color: #4b5563; }

/* ==================== 搜索工具栏 ==================== */
.toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select {
  padding: 8px 13px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px;
  outline: none; transition: .2s;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.1); }

/* ==================== 弹窗（毛玻璃背景） ==================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); z-index: 100;
  display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; padding: 28px; min-width: 440px; max-width: 92vw; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(229,231,235,.5);
}
.modal h3 { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); font-size: 17px; color: #111827; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ==================== 可滚动表格容器 ==================== */
.table-scroll {
  width: 100%; max-height: 520px; overflow: auto;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  position: relative; box-shadow: var(--shadow-sm);
}
.table-scroll table { min-width: 100%; border-collapse: separate; border-spacing: 0; }
.table-scroll thead th {
  position: sticky; top: 0; z-index: 2; background: #f9fafb;
  box-shadow: inset 0 -1px 0 var(--border);
}
.table-scroll tbody td { background: #fff; }
.table-scroll tbody tr:hover td { background: #f9fafb; }

/* ==================== 通用分页组件 ==================== */
.pagination {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 4px 0; justify-content: space-between;
  border-top: 1px dashed var(--border); margin-top: 10px;
}
.pagination .pg-info { font-size: 13px; color: #4b5563; flex: 1; min-width: 200px; }
.pagination .pg-info b { color: var(--primary); font-weight: 600; }
.pagination .pg-controls { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination .pg-btn {
  padding: 5px 11px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: #4b5563; min-width: 34px; transition: .2s;
}
.pagination .pg-btn:hover:not(:disabled):not(.active) { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.pagination .pg-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: var(--primary); font-weight: 500; }
.pagination .pg-btn:disabled { color: #9ca3af; cursor: not-allowed; background: #f3f4f6; }
.pagination .pg-ellipsis { color: #9ca3af; padding: 0 4px; }
.pagination .pg-size { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4b5563; }
.pagination .pg-size select {
  padding: 5px 9px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 13px; outline: none; cursor: pointer;
}
.pagination .pg-size select:focus { border-color: var(--primary); }

/* ==================== 空态与提示 ==================== */
.empty { text-align: center; padding: 48px; color: #9ca3af; font-size: 14px; }
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(17,24,39,.88); color: #fff; padding: 11px 20px; border-radius: 8px; z-index: 9999;
  font-size: 14px; backdrop-filter: blur(6px); box-shadow: var(--shadow-md);
}
