/* =============================================
   招聘后台管理系统 - 全局样式
   ============================================= */

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

:root {
  /* 品牌色 (与 H5 统一的科技蓝) */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-alpha: rgba(37, 99, 235, 0.1);
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --info-light: #eff6ff;
  
  /* 灰度色板 */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  
  /* 布局参数 */
  --sidebar-w: 240px;
  --header-h: 60px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif; 
  font-size: 14px; 
  color: var(--gray-700); 
  background: var(--gray-50); 
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; background: var(--gray-50); }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: #0f172a; /* 采用与H5海报相同的深沉科技蓝黑底色 */
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.05);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.sidebar-logo .logo-text { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: 0.5px; line-height: 1.2; }
.sidebar-logo .logo-sub { color: rgba(255,255,255,.4); font-size: 11px; margin-top: 2px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-group-title {
  padding: 8px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: var(--primary); box-shadow: 0 4px 12px var(--primary-alpha); }
.nav-item .icon { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,.05);
}
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-800) 100%); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}
.sidebar-user .uinfo { flex: 1; min-width: 0; }
.sidebar-user .uname { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .urole { color: rgba(255,255,255,.5); font-size: 12px; margin-top: 2px;}
.sidebar-user .logout-btn { color: rgba(255,255,255,.4); cursor: pointer; font-size: 18px; transition: color var(--transition); }
.sidebar-user .logout-btn:hover { color: var(--danger); }

/* ---- Main ---- */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; background: var(--gray-50); }

/* ---- Header ---- */
.header {
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--gray-500); font-size: 14px; font-weight: 500; }
.breadcrumb .sep { color: var(--gray-300); font-size: 12px; }
.breadcrumb .current { color: var(--gray-800); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 16px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100); border-radius: var(--radius);
  padding: 8px 16px; width: 260px;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.search-box:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}
.search-box input { border: none; background: transparent; outline: none; font-size: 14px; color: var(--gray-800); width: 100%; }
.search-box input::placeholder { color: var(--gray-400); }
.search-box .si { color: var(--gray-400); font-size: 14px; }

/* ---- Page Body ---- */
.page-body { padding: 32px 32px 48px; flex: 1; max-width: 1600px; margin: 0 auto; width: 100%; }

.page-title { font-size: 24px; font-weight: 700; color: var(--gray-800); margin-bottom: 24px; letter-spacing: 0.5px; }

/* ---- Cards ---- */
.card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); margin-bottom: 20px; transition: box-shadow var(--transition); }
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 24px; }

/* ---- Stat Cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-light);
  padding: 24px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.stat-card .sc-left { }
.stat-card .sc-label { font-size: 14px; color: var(--gray-500); margin-bottom: 8px; font-weight: 500; }
.stat-card .sc-value { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.stat-card .sc-value.blue { color: var(--info); }
.stat-card .sc-value.orange { color: var(--warning); }
.stat-card .sc-value.green { color: var(--success); }
.stat-card .sc-value.purple { color: var(--primary); }
.stat-card .sc-trend { margin-top: 8px; font-size: 13px; color: var(--success); font-weight: 500; }
.stat-card .sc-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}
.stat-card .sc-icon.blue { background: linear-gradient(135deg, var(--info-light) 0%, #dbeafe 100%); color: var(--info); }
.stat-card .sc-icon.orange { background: linear-gradient(135deg, var(--warning-light) 0%, #fef3c7 100%); color: #d97706; }
.stat-card .sc-icon.green { background: linear-gradient(135deg, var(--success-light) 0%, #d1fae5 100%); color: var(--success); }
.stat-card .sc-icon.purple { background: linear-gradient(135deg, var(--primary-light) 0%, #e0e7ff 100%); color: var(--primary); }

/* ---- Charts Row ---- */
.charts-row { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin-bottom: 24px; }
.chart-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-light); padding: 24px; box-shadow: var(--shadow-sm); }
.chart-card h3 { font-size: 16px; font-weight: 600; color: var(--gray-800); margin-bottom: 20px; display: flex; align-items: center; gap: 8px;}

/* Bar Chart */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: flex; align-items: center; gap: 10px; }
.bar-item .bar-label { width: 90px; font-size: 13px; color: var(--gray-600); text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-item .bar-track { flex: 1; height: 18px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.bar-item .bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 6px; }
.bar-item .bar-fill .bar-val { font-size: 11px; color: #fff; font-weight: 600; }
.bar-fill.c1 { background: #6366f1; }
.bar-fill.c2 { background: #3b82f6; }
.bar-fill.c3 { background: #10b981; }
.bar-fill.c4 { background: #f59e0b; }
.bar-fill.c5 { background: #ec4899; }
.bar-fill.c6 { background: #8b5cf6; }
.bar-fill.c7 { background: #06b6d4; }
.bar-fill.c8 { background: #f97316; }

/* Donut Chart */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.donut-canvas-wrap { position: relative; width: 160px; height: 160px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .total-num { font-size: 28px; font-weight: 700; color: var(--gray-800); }
.donut-center .total-label { font-size: 12px; color: var(--gray-500); }
.donut-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gray-600); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-light); background: #fff;}
table { width: 100%; border-collapse: collapse; }
thead th { padding: 14px 16px; text-align: left; font-size: 13px; color: var(--gray-500); font-weight: 600; border-bottom: 2px solid var(--gray-100); background: #fafafa; white-space: nowrap; }
tbody td { padding: 16px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; color: var(--gray-800); vertical-align: middle; }
tbody tr { transition: background var(--transition); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ---- Status Badges ---- */
.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-submitted { background: var(--warning-light); color: #d97706; }
.badge-reviewing { background: var(--info-light); color: var(--info); }
.badge-passed { background: var(--success-light); color: var(--success); }
.badge-rejected { background: var(--danger-light); color: var(--danger); }
.badge-open { background: var(--success-light); color: var(--success); }
.badge-closed { background: var(--gray-100); color: var(--gray-500); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all var(--transition); user-select: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-alpha); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px var(--primary-alpha); }
.btn-outline { background: #fff; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-800); }
.btn-ghost { background: transparent; color: var(--primary); padding: 6px 12px; font-size: 13px; font-weight: 600; }
.btn-ghost:hover { background: var(--primary-light); border-radius: var(--radius-sm); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2); }
.btn-success:hover { background: #059669; }

/* ---- Filter Tabs ---- */
.tab-bar { display: flex; gap: 6px; background: var(--gray-100); border-radius: 10px; padding: 4px; width: fit-content; margin-bottom: 20px; }
.tab-item { padding: 6px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--gray-600); transition: all var(--transition); }
.tab-item.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.tab-item:hover:not(.active) { color: var(--gray-800); background: rgba(255,255,255,0.5); }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 24px; }
.pg-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; border: 1px solid var(--gray-200); background: #fff; color: var(--gray-600); transition: all var(--transition); font-weight: 500; }
.pg-btn:hover:not(.disabled) { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-800); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px var(--primary-alpha); }
.pg-btn.disabled { opacity: 0.5; cursor: not-allowed; background: var(--gray-50); }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal { background: #fff; border-radius: var(--radius-xl); width: 600px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.modal-header { padding: 24px 32px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-800); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gray-400); font-size: 20px; transition: all var(--transition); }
.modal-close:hover { background: var(--gray-100); color: var(--gray-800); transform: rotate(90deg); }
.modal-body { padding: 24px 32px; }
.modal-footer { padding: 0 32px 24px; display: flex; justify-content: flex-end; gap: 12px; }

/* ---- Form ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 14px; color: var(--gray-700); font-weight: 500; }
.form-label .req { color: var(--danger); margin-left: 4px; }
.form-control {
  padding: 12px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-800); background: #fff; outline: none;
  transition: all var(--transition); line-height: 1.5;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-alpha); }
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
select.form-control { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;}

/* ---- Avatar ---- */
.applicant-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

/* ---- Filter Input ---- */
.filter-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100); border-radius: var(--radius-sm); padding: 8px 16px;
  border: 1px solid transparent; transition: all var(--transition);
}
.filter-input:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}
.filter-input input { border: none; background: transparent; outline: none; font-size: 14px; color: var(--gray-800); width: 200px; }
.filter-input input::placeholder { color: var(--gray-400); }

/* ---- Detail Page ---- */
.detail-section { margin-bottom: 32px; }
.detail-section h4 { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; }
.detail-section h4::before { content: ''; display: block; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; }
.detail-item { background: #fafafa; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.detail-item .di-label { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; font-weight: 500; }
.detail-item .di-value { font-size: 14px; color: var(--gray-800); font-weight: 500; word-break: break-all; }

/* ---- Job stats bar ---- */
.job-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.job-stat-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border-light); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); transition: transform var(--transition); }
.job-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.job-stat-card .jsv { font-size: 32px; font-weight: 800; line-height: 1; }
.job-stat-card .jsl { font-size: 13px; color: var(--gray-500); margin-top: 8px; font-weight: 500; }
.jsv.blue { color: var(--info); }
.jsv.orange { color: var(--warning); }
.jsv.teal { color: #0891b2; }
.jsv.purple { color: var(--primary); }
.jsv.red { color: var(--danger); }

/* ---- Toast ---- */
#toast-container { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-lg); border-left: 4px solid; font-size: 14px; min-width: 280px; font-weight: 500; animation: slideIn .3s cubic-bezier(0.4, 0, 0.2, 1); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Login Page ---- */
.login-page { min-height: 100vh; background: #0f172a; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; width: 600px; height: 600px; background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(15, 23, 42, 0) 70%); top: -100px; left: -100px; border-radius: 50%; }
.login-box { background: #fff; border-radius: var(--radius-xl); padding: 48px 40px; width: 400px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); position: relative; z-index: 10; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%); color: #fff; font-size: 32px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; box-shadow: 0 8px 16px var(--primary-alpha); }
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--gray-800); letter-spacing: 0.5px; }
.login-logo p { font-size: 14px; color: var(--gray-500); margin-top: 6px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form .form-label { display: block; font-size: 14px; color: var(--gray-700); margin-bottom: 8px; font-weight: 600; }
.login-form .form-control { width: 100%; padding: 12px 14px; font-size: 15px; }
.login-btn { width: 100%; padding: 14px; font-size: 16px; font-weight: 700; margin-top: 12px; border-radius: var(--radius); }
.login-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px; font-weight: 500; }

/* ---- Responsive (hide sidebar on small screens) ---- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}
