/* ============================================
   招聘推荐悬赏平台 MVP — 全局样式
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #0052d9;
  --primary-light: #e8f0fe;
  --primary-hover: #003cab;
  --success: #00a870;
  --success-light: #e8f8f2;
  --warning: #ed7b2f;
  --warning-light: #fef3e6;
  --danger: #e34d59;
  --danger-light: #fdecee;
  --text: #333;
  --text-secondary: #666;
  --text-placeholder: #bbb;
  --border: #dcdcdc;
  --bg: #f5f7fa;
  --bg-white: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-sm: 4px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* 布局 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 顶部导航 */
.navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-brand { font-size: 18px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.navbar-brand a { color: var(--primary); text-decoration: none; }
.navbar-nav { display: flex; align-items: center; gap: 20px; }
.navbar-nav a { color: var(--text-secondary); text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: var(--radius-sm); transition: all 0.2s; }
.navbar-nav a:hover, .navbar-nav a.active { color: var(--primary); background: var(--primary-light); }

/* 通知角标 */
.notif-badge {
  position: relative; display: inline-flex; align-items: center; cursor: pointer;
}
.notif-badge .dot {
  position: absolute; top: -4px; right: -8px;
  width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
  display: none;
}
.notif-badge .dot.show { display: block; }

/* 页面标题 */
.page-header { margin: 24px 0 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header .subtitle { font-size: 14px; color: var(--text-secondary); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
  white-space: nowrap;
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #008858; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c9353f; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 卡片 */
.card {
  background: var(--bg-white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px;
  overflow: visible;
  /* 关键：吸底法律页脚(.legal-footer) z-index:1，卡片须更高以免被页脚盖住按钮（如推荐人登录页） */
  position: relative; z-index: 2;
}
.card-header { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-body { overflow-x: auto; }
.card-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: var(--bg-white); transition: border-color 0.2s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.form-input::placeholder { color: var(--text-placeholder); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg); padding: 10px 12px; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 10px 12px; font-size: 14px; border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--primary-light); }

/* 徽标/阶段标签 */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 10px; font-size: 10px; font-weight: 500;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-default { background: var(--bg); color: var(--text-secondary); }

/* 状态标签 */
.status-open { color: var(--success); }
.status-closed { color: var(--text-placeholder); }

/* 看板列 */
.kanban {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.kanban-col {
  flex: 1 1 0;
  min-width: 180px;
  max-width: none;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px;
  overflow: hidden;
}
.kanban-col-title {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 8px; display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.kanban-col-title .count {
  background: var(--border); color: var(--text-secondary);
  padding: 0 6px; border-radius: 10px; font-size: 10px;
}
.kanban-card {
  background: var(--bg-white); border-radius: var(--radius-sm);
  padding: 8px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.kanban-card .name { font-size: 12px; font-weight: 600; margin-bottom: 1px; }
.kanban-card .meta { font-size: 10px; color: var(--text-secondary); }
.kanban-card .actions { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: var(--bg-white); border-radius: var(--radius);
  padding: 24px; min-width: 400px; max-width: 600px; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.modal-footer { margin-top: 20px; display: flex; gap: 12px; justify-content: flex-end; }

/* Toast 消息 */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-placeholder); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .text { font-size: 14px; }

/* 登录页 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: var(--bg-white); border-radius: var(--radius);
  padding: 40px; width: 400px; box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.login-card h2 { text-align: center; margin-bottom: 8px; color: var(--text); }
.login-card .sub { text-align: center; font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.login-card .toggle-link { text-align: center; margin-top: 16px; font-size: 14px; }
.login-card .toggle-link a { color: var(--primary); cursor: pointer; text-decoration: none; }

/* 岗位列表卡片 */
.job-card {
  background: var(--bg-white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 12px;
  display: flex; align-items: flex-start; justify-content: space-between;
  cursor: pointer; transition: all 0.2s; border: 1px solid transparent;
}
.job-card:hover { border-color: var(--primary); }
.job-card .left { flex: 1; }
.job-card .title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.job-card .company { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.job-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.job-card .stages-preview { font-size: 12px; color: var(--text-secondary); }
.job-card .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: 20px; }
.job-card .expiry { font-size: 12px; color: var(--text-placeholder); }
.job-card .stats { font-size: 13px; color: var(--text-secondary); }

/* 岗位详情页 Header */
.job-header {
  background: var(--bg-white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.job-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.job-header .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.job-header .stages { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.job-header .share-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 时间线 */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -20px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--success);
  border: 2px solid var(--bg-white);
}
.timeline-item.pending::before { background: var(--text-placeholder); }
.timeline-item .date { font-size: 12px; color: var(--text-placeholder); }
.timeline-item .content { font-size: 14px; color: var(--text); margin-top: 2px; }

/* 佣金进度条 */
.bounty-bar {
  height: 8px; background: var(--bg); border-radius: 4px; margin: 8px 0; overflow: hidden;
}
.bounty-bar .fill { height: 100%; background: var(--success); border-radius: 4px; transition: width 0.3s; }

/* 计数 */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; background: var(--primary); color: #fff;
  border-radius: 10px; font-size: 11px; padding: 0 6px;
}

/* 链接/文字 */
.text-muted { color: var(--text-placeholder); font-size: 12px; }
.text-small { font-size: 12px; }
.link { color: var(--primary); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* 弹性布局 */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mr-8 { margin-right: 8px; }

/* 进度条（推荐节点） */
.prog-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--text-placeholder);
  flex-shrink: 0;
}
.dot-completed { border-color: var(--success); background: var(--success); color: #fff; }
.dot-active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); box-shadow: 0 0 0 4px rgba(0,82,217,0.15); }
.dot-pending { border-color: var(--border); background: var(--bg-white); color: var(--text-placeholder); }
.dot-waiting { border-color: var(--border); border-style: dashed; background: var(--bg-white); color: var(--text-placeholder); }
.dot-cancelled { border-color: var(--danger); background: var(--danger-light); color: var(--danger); }

@media (max-width: 480px) {
  .prog-dot { width: 22px; height: 22px; font-size: 11px; }
}

/* 响应式 */
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .kanban { flex-direction: column; }
  .kanban-col { min-width: auto; }
  .login-card { width: 90%; padding: 24px; }
  .job-card { flex-direction: column; }
  .job-card .right { margin-left: 0; margin-top: 12px; flex-direction: row; }
  /* 手机端卡片内边距缩减 */
  .card { padding: 16px; }
  /* Toast 消息适配窄屏，防止溢出 */
  .toast-container { right: 8px; left: 8px; }
  .toast { max-width: 100%; font-size: 13px; padding: 10px 16px; }
  /* 导航栏缩减内边距 */
  .navbar { padding: 0 12px; }
  .navbar-brand { font-size: 16px; }
  .navbar-nav { gap: 12px; }
  .navbar-nav a { font-size: 13px; padding: 4px 8px; }
  /* 弹窗适配窄屏 */
  .modal { min-width: auto; width: 90%; padding: 20px; max-width: none; }
  .modal-title { font-size: 16px; }
  /* 页面标题缩小 */
  .page-header h1 { font-size: 20px; }
  /* 表格字体缩小 */
  thead th { font-size: 12px; padding: 8px 6px; }
  tbody td { font-size: 13px; padding: 8px 6px; }
  /* 按钮组换行 */
  .page-header { flex-direction: column; align-items: flex-start; }
  /* 看板卡片微调 */
  .kanban-col { max-width: none; }
}

/* 小屏手机精细适配 */
/* 钱包统计卡片：桌面4列，手机2列 */
.wallet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .wallet-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .wallet-stats .card { padding: 12px 8px; }
  .wallet-stats .card > div:first-child { font-size: 11px; }
  .wallet-stats .card > div:nth-child(2) { font-size: 18px !important; }
}
@media (max-width: 480px) {
  .prog-dot { width: 22px; height: 22px; font-size: 11px; }
  /* 大按钮适度缩小，保证触控区域 */
  .btn-lg { padding: 10px 20px; font-size: 15px; }
  /* 小屏卡片进一步缩减 */
  .card { padding: 12px; }
  .card-header { font-size: 15px; }
  /* 弹窗边距更紧凑 */
  .modal { width: 95%; padding: 16px; }
  /* 表格超小屏横滚 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  /* 表单组减少间距 */
  .form-group { margin-bottom: 12px; }
  /* 登录卡片 */
  .login-card { width: 95%; padding: 20px; }
}

/* ===== 法律页脚（用户协议 / 隐私政策） ===== */
.legal-footer, .site-footer {
  text-align: center;
  padding: 26px 16px;
  margin-top: 40px;
  font-size: 13px;
  color: var(--text-placeholder);
  border-top: 1px solid var(--border);
}
.legal-footer a, .site-footer a { color: var(--text-secondary); text-decoration: none; }
.legal-footer a:hover, .site-footer a:hover { color: var(--primary); text-decoration: underline; }
.legal-footer span, .site-footer span { margin: 0 8px; }

/* 登录/注册页（.login-page 全屏 flex 居中）：法律页脚脱离 flex 流，吸底 */
.login-page .legal-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  border-top: none;
  background: transparent;
  color: rgba(255,255,255,.45);
  padding: 16px;
  font-size: 12px;
}
.login-page .legal-footer a { color: rgba(255,255,255,.65); }
.login-page .legal-footer a:hover { color: #fff; }

/* ===== 同意协议勾选（登录/注册页） ===== */
.agree-row { margin: 14px 0 6px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.agree-row a { color: var(--primary); text-decoration: none; }
.agree-row a:hover { text-decoration: underline; }
.agree-row input[type=checkbox] { vertical-align: middle; margin-right: 5px; width: 15px; height: 15px; }
