/* ============================================================
   招聘项目管理系统 - 全局样式
   核心层对齐版 · 蓝主色 #1677ff + 深色渐变头 + 白卡片 12px 圆角
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Variables */
:root {
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-hover: #f4f4f5;
  --bg-sidebar: #f4f4f5;
  --bg-sidebar-active: #ffffff;
  --border: #e8e8e8;
  --border-light: #f0f0f1;
  --text-primary: #1a1a2e;
  --text-secondary: #666;
  --text-tertiary: #a1a1aa;
  /* 主色对齐核心层 */
  --primary: #1677ff;
  --blue: #1677ff;
  --blue-light: #e6f0ff;
  --green: #16a34a;
  --green-light: #dcfce7;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --sidebar-w: 200px;
  --gradient-header: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Base */
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
/* 品牌区对齐核心层：深色渐变头 */
.sidebar-logo {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-header);
  color: #fff;
}
.sidebar-logo .logo-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  backdrop-filter: blur(4px);
}
.sidebar-logo .logo-text { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: 0.5px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.nav-item.active { background: var(--bg-sidebar-active); color: var(--blue); box-shadow: var(--shadow); font-weight: 600; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-footer .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.sidebar-footer .user-info { font-size: 12px; }
.sidebar-footer .user-info .name { font-weight: 600; color: var(--text-primary); }
.sidebar-footer .user-info .role { color: var(--text-tertiary); font-size: 11px; }

/* Main Content */
.content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.page-header { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.page-header h1 { font-size: 18px; font-weight: 700; }
.page-header .subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.page-header .actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
  padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-primary);
  transition: all 0.15s;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #0f5fd8; }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.section-title { font-size: 14px; font-weight: 700; margin: 20px 0 10px; }

/* Alert Banner */
.alert-banner {
  background: #fff7ed; border: 1px solid #fdba74; border-radius: var(--radius);
  padding: 10px 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.alert-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.alert-banner .text { font-size: 12px; font-weight: 600; color: #92400e; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 16px; }
.kpi-card .label { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.kpi-card .value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.kpi-card .unit { font-size: 12px; color: var(--text-tertiary); font-weight: 400; margin-left: 2px; }
.kpi-card .trend { font-size: 11px; margin-top: 4px; }
.kpi-card .trend.up { color: var(--green); }
.kpi-card .trend.down { color: var(--red); }
.kpi-card .mini-bar { width: 100%; height: 4px; background: var(--bg-hover); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.kpi-card .mini-bar .fill { height: 100%; border-radius: 2px; }
.kpi-card .meta { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; }

/* Dashboard Grid */
.dash-row { display: grid; gap: 12px; margin-bottom: 16px; }
.dash-row.two { grid-template-columns: 1fr 1fr; }
.dash-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* Funnel */
.funnel-item { display: flex; align-items: center; margin-bottom: 6px; }
.funnel-item .label { width: 60px; font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.funnel-item .bar { flex: 1; height: 22px; border-radius: 4px; display: flex; align-items: center; padding: 0 10px; }
.funnel-item .bar .bar-text { font-size: 11px; font-weight: 600; color: #fff; }
.funnel-item .rate { width: 48px; text-align: right; font-size: 10px; color: var(--text-tertiary); }

/* Progress Bar */
.progress-bar { width: 100%; height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 4px; }

/* Team List */
.team-table { width: 100%; border-collapse: collapse; }
.team-table th { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.team-table td { padding: 10px; font-size: 12px; border-bottom: 1px solid var(--border-light); }
.team-table tr:hover { background: var(--bg-hover); }
.team-table .name-cell { display: flex; align-items: center; gap: 8px; }
.team-table .avatar-sm { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-online { background: var(--green); }
.status-away { background: var(--amber); }
.status-offline { background: var(--text-tertiary); }

/* Tag */
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-amber { background: var(--amber-light); color: #92400e; }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-gray { background: var(--bg-hover); color: var(--text-secondary); }

/* Kanban */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { flex: 1; min-width: 240px; background: var(--bg-hover); border-radius: var(--radius); padding: 10px; }
.kanban-column-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kanban-column-header .title { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kanban-column-header .count { background: var(--border); color: var(--text-secondary); font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.kanban-card { background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.kanban-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.kanban-card .card-title { font-size: 12px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.kanban-card .card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--text-tertiary); }
.kanban-card .card-tags { display: flex; gap: 4px; margin-bottom: 6px; }
.kanban-card .card-progress { font-size: 10px; color: var(--blue); font-weight: 600; }
.priority-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.priority-high { background: var(--red); }
.priority-medium { background: var(--amber); }
.priority-low { background: var(--text-tertiary); }

/* Campus Table */
.campus-table { width: 100%; border-collapse: collapse; }
.campus-table th { text-align: left; padding: 7px 10px; font-size: 11px; font-weight: 700; color: var(--text-secondary); background: var(--bg-hover); border-bottom: 1px solid var(--border); }
.campus-table th:first-child { border-radius: 4px 0 0 4px; }
.campus-table th:last-child { border-radius: 0 4px 4px 0; }
.campus-table td { padding: 7px 10px; font-size: 12px; border-bottom: 1px solid var(--border-light); }
.campus-table tr:hover { background: var(--bg-hover); }
.campus-table .type-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.type-badge.study { background: var(--blue-light); color: var(--blue); }
.type-badge.edu { background: var(--green-light); color: var(--green); }
.type-badge.care { background: var(--amber-light); color: #92400e; }
.campus-summary-row { background: var(--bg-hover); font-weight: 700; }

/* Settings */
.settings-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.settings-tab { padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.settings-tab:hover { color: var(--text-primary); }
.settings-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Permission Matrix */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 10px; text-align: center; font-size: 12px; border: 1px solid var(--border); }
.perm-table th { background: var(--bg-hover); font-weight: 700; color: var(--text-secondary); }
.perm-table td:first-child { text-align: left; font-weight: 600; }
.perm-yes { color: var(--green); font-weight: 700; }
.perm-no { color: var(--text-tertiary); }

/* Chart container */
.chart-container { position: relative; width: 100%; }

/* Activity timeline */
.activity-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.activity-item:last-child { border-bottom: none; }
.activity-item .time { font-size: 10px; color: var(--text-tertiary); width: 80px; flex-shrink: 0; }
.activity-item .content { font-size: 12px; color: var(--text-secondary); }
.activity-item .content .user { font-weight: 600; color: var(--text-primary); }

/* Scrollbar */
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 3px; }
.content::-webkit-scrollbar-track { background: transparent; }

/* Responsive */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row.two, .dash-row.three { grid-template-columns: 1fr; }
}
