/* ============ 打拼在40年华 全局样式（简洁风，参考 BOSS直聘） ============ */
:root {
  --brand: #00bebc;          /* 品牌绿（BOSS直聘主色） */
  --brand-dark: #00a5a3;
  --salary: #fd7035;         /* 薪资橙红 */
  --text: #26292c;
  --muted: #8d929a;
  --border: #e8eaed;
  --bg: #f6f7f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.main { min-height: calc(100vh - 130px); padding-top: 20px; padding-bottom: 40px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.prewrap { white-space: pre-wrap; line-height: 1.8; }
h2 { margin-bottom: 14px; font-size: 20px; }
h3 { margin: 18px 0 10px; font-size: 16px; }

/* ---------- 导航栏 ---------- */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; height: 56px; gap: 24px; }
.brand {
  font-size: 22px; font-weight: 700; color: var(--brand);
  letter-spacing: 1px;
}
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a:hover { color: var(--brand); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-right a:hover { color: var(--brand); }
.username { font-weight: 600; }
.role-tag {
  font-size: 12px; padding: 2px 8px; border-radius: 10px;
  background: #e6f7f7; color: var(--brand);
}
.role-company { background: #fff4e6; color: #ff9500; }
.role-admin { background: #fdeaea; color: #e5484d; }
.bell { position: relative; }
.badge-dot {
  position: absolute; top: -8px; right: -12px;
  background: #e5484d; color: #fff; font-size: 11px;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: 1px solid var(--border);
  background: #fff; color: var(--text);
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  font-size: 14px; text-align: center;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-danger { color: #e5484d; }
.btn-danger:hover { border-color: #e5484d; color: #e5484d; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 18px;
}

/* ---------- 提示条 ---------- */
.flash {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 14px;
  font-size: 14px;
}
.flash-success { background: #e8f7f0; color: #0a8f5b; }
.flash-danger  { background: #fdeaea; color: #e5484d; }
.flash-warning { background: #fff6e5; color: #b8860b; }
.flash-info    { background: #e8f1fd; color: #2470c8; }

/* ---------- 首页搜索 ---------- */
.search-hero { padding: 26px; margin-bottom: 20px; }
.search-form { display: flex; gap: 10px; }
.search-form input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none;
}
.search-form input:focus { border-color: var(--brand); }
.search-form .city { flex: 0 0 180px; }
.search-form .btn { padding: 11px 28px; }

/* ---------- 匹配提醒横幅（核心亮点） ---------- */
.match-banner {
  background: linear-gradient(135deg, #e6f7f7, #f0fbf9);
  border: 1px solid #b5e8e8; border-radius: 8px;
  padding: 14px 18px; margin-bottom: 20px;
}
.match-banner-title {
  color: var(--brand-dark); font-weight: 700; margin-bottom: 10px;
}
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px;
}
.match-item:hover { border-color: var(--brand); }
.match-pct {
  color: var(--salary); font-weight: 700; font-size: 15px;
  min-width: 48px;
}
.match-name { font-weight: 600; }
.match-item .muted { margin-left: auto; }

/* ---------- 职位卡片 ---------- */
.job-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.job-card { transition: border-color .15s; }
.job-card:hover { border-color: var(--brand); }
.job-top { display: flex; justify-content: space-between; align-items: baseline; }
.job-title { font-size: 16px; font-weight: 700; }
.salary { color: var(--salary); font-weight: 700; font-size: 15px; }
.job-tags { color: var(--muted); margin-top: 8px; display: flex; gap: 10px; }
.job-bottom {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.company { color: #2470c8; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
/* 详情页中关键词行紧跟信息行时增加上间距 */
.job-tags + .tag-row { margin-top: 10px; }
.tag {
  background: #f1f3f5; color: #5b6067; font-size: 12px;
  padding: 2px 8px; border-radius: 4px;
}

/* ---------- 简历页求职状态开关 ---------- */
.seeking-toggle {
  margin: 10px 0 16px; padding: 10px 14px;
  background: #f8f9fa; border: 1px solid var(--border); border-radius: 6px;
}
.seeking-toggle label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.seeking-toggle input { width: auto; }

/* ---------- 详情页 ---------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.apply-area { margin-top: 20px; }
.apply-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; margin-bottom: 10px; font-size: 14px; resize: vertical;
}
.apply-form textarea:focus { outline: none; border-color: var(--brand); }

/* ---------- 表单 ---------- */
label { display: block; margin: 12px 0 6px; color: #5b6067; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; outline: none; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { resize: vertical; }
form .btn { margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-row { display: flex; gap: 20px; }
.radio { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.radio input { width: auto; }
.company-fields {
  border-top: 1px dashed var(--border); margin-top: 8px;
  padding-top: 4px;
}

/* ---------- 登录注册 ---------- */
.auth-card {
  max-width: 460px; margin: 30px auto; padding: 28px;
}
.auth-tip { margin-top: 14px; text-align: center; }
.auth-tip a { color: var(--brand); }
.demo-accounts { margin-top: 16px; font-size: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }

/* ---------- 表格 ---------- */
.table-card { padding: 6px 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

/* ---------- 状态徽标 ---------- */
.app-status, .job-status {
  font-size: 12px; padding: 3px 10px; border-radius: 12px; white-space: nowrap;
}
.st-submitted { background: #eef1f4; color: #5b6067; }
.st-viewed { background: #e8f1fd; color: #2470c8; }
.st-interview { background: #e8f7f0; color: #0a8f5b; }
.st-rejected { background: #fdeaea; color: #e5484d; }
.st-approved { background: #e8f7f0; color: #0a8f5b; }
.st-pending { background: #fff6e5; color: #b8860b; }
.st-offline { background: #eef1f4; color: #8d929a; }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--brand); }
.stat-label { color: var(--muted); margin-top: 4px; }

/* ---------- 通知 ---------- */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.notif:hover { border-color: var(--brand); }
.notif.unread { border-left: 3px solid var(--brand); background: #f4fdfd; }
.notif-time { white-space: nowrap; }

/* ---------- AI 岗位生成 ---------- */
.ai-jd-box {
  max-width: 720px; margin-bottom: 16px;
  background: linear-gradient(135deg, #f0fbf9, #f7f4ff);
  border-color: #b5e8e8;
}
.ai-input-row { display: flex; gap: 10px; align-items: stretch; margin-top: 10px; }
.ai-input-row textarea { flex: 1; }
.ai-input-row .btn { margin-top: 0; white-space: nowrap; }
.ai-status { margin-top: 8px; font-size: 13px; min-height: 18px; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 20px 0;
}

/* ---------- 沟通对话 ---------- */
.badge-inline {                       /* 会话列表未读数 */
  background: #e5484d; color: #fff; font-size: 11px;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.badge-inline-nav { position: static; margin-left: 2px; }
.notif-meta { display: flex; align-items: center; gap: 8px; }

.chat-wrap { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 420px; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfc;
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 70%; align-self: flex-start; }
.msg.me { align-self: flex-end; }
.msg-bubble {
  background: #f1f3f5; border-radius: 12px 12px 12px 2px;
  padding: 9px 13px; line-height: 1.6; word-break: break-word;
}
.msg.me .msg-bubble {
  background: var(--brand); color: #fff; border-radius: 12px 12px 2px 12px;
}
.msg-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg.me .msg-time { text-align: right; }
.chat-input {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: #fafbfc;
}
.chat-input input { flex: 1; }
.chat-input .btn { margin-top: 0; }

@media (max-width: 760px) {
  body { font-size: 13px; }
  .container { padding: 0 12px; }
  .main { padding-top: 12px; }
  .card { padding: 14px; }

  /* 导航：单行放不下的项隐藏，右侧只保留核心元素 */
  .nav-inner { gap: 10px; }
  .brand { font-size: 18px; }
  .nav-links { gap: 12px; font-size: 13px; }
  .nav-right { gap: 8px; }
  .role-tag, .username { display: none; }

  /* 列表单列，搜索纵向堆叠 */
  .job-list { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .search-form { flex-direction: column; }
  .search-form .city { flex: 1; }
  .search-hero { padding: 16px; }

  /* 表单两列降为单列 */
  .two-col { grid-template-columns: 1fr; }

  /* 登录注册卡占满宽度 */
  .auth-card { margin: 16px auto; padding: 20px; max-width: none; }

  /* 匹配提醒项：信息纵向排列避免挤压 */
  .match-item { flex-wrap: wrap; gap: 6px; }
  .match-item .muted { margin-left: 0; width: 100%; }

  /* 统计卡片两列 */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-num { font-size: 20px; }

  /* 表格小屏横向滑动，防止撑破布局 */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px 10px; white-space: nowrap; }
  td .btn { padding: 4px 8px; }

  /* 通知列表纵向排列 */
  .notif { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* 底部留点呼吸空间 */
  .footer { padding: 16px 0; }
  /* AI 生成按钮在小屏纵向排列 */
  .ai-input-row { flex-direction: column; }
  .ai-input-row .btn { width: 100%; }
}

/* 超小屏（<=400px）：进一步收紧 */
@media (max-width: 400px) {
  .nav-links { gap: 8px; }
  .job-title { font-size: 15px; }
  .salary { font-size: 14px; }
}

/* ---------- 首页分页条 ---------- */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 32px;
}
.page-total { color: var(--muted, #888); font-size: 13px; }
.page-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.page-btn {
  display: inline-block;
  min-width: 34px;
  padding: 6px 10px;
  text-align: center;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text, #333);
  text-decoration: none;
  background: #fff;
  transition: border-color .15s, color .15s;
}
a.page-btn:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.page-btn.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
}
.page-btn.disabled { color: #bbb; background: #f7f7f7; cursor: not-allowed; }
