:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --primary: #1f6feb;
  --primary-dark: #1551b5;
  --accent: #ff8a3d;
  --text: #1c2530;
  --muted: #6b7785;
  --border: #e3e9f0;
  --ok: #1f9d55;
  --warn: #d9920a;
  --danger: #d6453d;
  --shadow: 0 4px 16px rgba(31, 53, 80, .08);
  --radius: 12px;
  --fs: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs);
  line-height: 1.6;
}
body.big-font { --fs: 19px; }

a { color: var(--primary); text-decoration: none; cursor: pointer; }
button { font-family: inherit; font-size: 1em; cursor: pointer; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 22px; background: var(--panel);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.logo { font-size: 1.6em; }
.brand-name { font-weight: 800; font-size: 1.15em; letter-spacing: .5px; }
.brand-sub { color: var(--muted); font-size: .72em; border-left: 1px solid var(--border); padding-left: 8px; }
.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600;
}
.nav a.active, .nav a:hover { background: #eaf1ff; color: var(--primary-dark); }
.nav-group {
  display: inline-flex; align-items: center;
  color: var(--muted); font-size: .82em; font-weight: 600;
  padding: 6px 0 6px 8px; white-space: nowrap;
}
.top-actions { display: flex; gap: 8px; align-items: center; }

/* 后台左侧边栏（默认隐藏，admin-layout 下显示） */
.sidebar { display: none; }
body.admin-layout { }
body.admin-layout .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
body.admin-layout .nav { display: none; }
body.admin-layout .sidebar {
  display: flex; flex-direction: column;
  position: fixed; top: 57px; left: 0; bottom: 0; width: 220px;
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 14px 0; overflow-y: auto; z-index: 25;
}
body.admin-layout .container {
  max-width: none; margin: 78px 18px 22px 238px; min-height: calc(100vh - 100px);
}
body.admin-layout .footer { margin-left: 220px; }

.sidebar-group { padding: 10px 18px 4px; font-size: .78em; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.sidebar a {
  display: block; padding: 9px 18px; color: var(--text); font-weight: 600; border-left: 3px solid transparent;
}
.sidebar a:hover { background: #f7faff; color: var(--primary-dark); }
.sidebar a.active { background: #eaf1ff; color: var(--primary-dark); border-left-color: var(--primary); }
.sidebar a.exit { color: var(--danger); margin-top: auto; }

.btn-ghost {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 8px; font-weight: 600;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.container { max-width: 1180px; margin: 22px auto; padding: 0 18px; }
.footer {
  text-align: center; color: var(--muted); font-size: .8em; padding: 24px;
  border-top: 1px solid var(--border); margin-top: 30px;
}
.footer .muted { margin-left: 10px; }

/* 通用按钮 */
.btn {
  border: none; border-radius: 9px; padding: 9px 16px; font-weight: 700;
  background: var(--primary); color: #fff; transition: .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #eef2f7; color: var(--text); }
.btn.secondary:hover { background: #e1e8f1; }
.btn.accent { background: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 10px; font-size: .85em; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 卡片/面板 */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.page-title { font-size: 1.4em; font-weight: 800; margin: 4px 0 2px; }
.page-desc { color: var(--muted); margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* 岗位卡片 */
.job-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; transition: .15s; }
.job-card:hover { box-shadow: var(--shadow); border-color: #cfe0ff; }
.job-card h3 { margin: 0 0 6px; font-size: 1.1em; }
.tag { display: inline-block; background: #eaf1ff; color: var(--primary-dark); border-radius: 6px; padding: 2px 8px; font-size: .78em; margin: 2px 4px 2px 0; font-weight: 700; }
.tag.gray { background: #eef2f7; color: var(--muted); }
.tag.ok { background: #e7f7ee; color: var(--ok); }

/* 表单 */
.field { margin-bottom: 14px; }
.form-section-title {
  font-size: 1.1em; font-weight: 800; color: var(--primary-dark);
  margin: 22px 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }
.field > label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .req { color: var(--danger); margin-left: 3px; }
.field .hint { color: var(--muted); font-size: .8em; margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1em; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd4ff; border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.opt input { width: auto; }

/* 表格（Excel 式台账） */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
table.ledger { border-collapse: collapse; width: 100%; font-size: .9em; }
table.ledger th, table.ledger td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; white-space: nowrap; }
table.ledger th { background: #f1f5fb; position: sticky; top: 0; font-weight: 700; }
table.ledger tbody tr:hover { background: #f7faff; }
.row-actions { display: flex; gap: 6px; }

/* 状态徽标 */
.status-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: .78em; font-weight: 700; background: #eef2f7; color: var(--muted); }
.status-badge.s-new { background: #eaf1ff; color: var(--primary-dark); }
.status-badge.s-progress { background: #fff3e0; color: var(--warn); }
.status-badge.s-ok { background: #e7f7ee; color: var(--ok); }
.status-badge.s-fail { background: #fdeceb; color: var(--danger); }

/* 工具条 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar .spacer { flex: 1; }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,45,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; max-width: 760px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Toast */
#toastRoot { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1c2530; color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); animation: pop .2s; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* 语音/填报模式切换 */
.mode-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mode-tab { flex: 1; min-width: 130px; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 12px; text-align: center; font-weight: 700; cursor: pointer; transition: .15s; }
.mode-tab:hover { border-color: var(--primary); background: #f7faff; }
.mode-tab.active { border-color: var(--primary); background: #eaf1ff; color: var(--primary-dark); }
.mode-tab .ic { font-size: 1.5em; display: block; }

/* 表单设计器 tab（底部指示线，明确可点击） */
.form-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.form-tab { padding: 10px 22px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: .15s; user-select: none; }
.form-tab:hover { color: var(--primary); }
.form-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.muted { color: var(--muted); }
.center-empty { text-align: center; color: var(--muted); padding: 40px; }
.pill { font-size: .8em; background: #eef2f7; padding: 2px 8px; border-radius: 12px; }
.warn-box { background: #fff8ec; border: 1px solid #ffe2b0; color: #8a5a00; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.island { background: #f7faff; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; margin-top: 10px; }
.memo-item { border-left: 3px solid var(--primary); padding: 8px 12px; background: #f7faff; border-radius: 0 8px 8px 0; margin-bottom: 8px; }
.memo-item .meta { font-size: .76em; color: var(--muted); }
.speaking { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(31,111,235,.4);} 50% { box-shadow: 0 0 0 8px rgba(31,111,235,0);} }
.kbd { font-family: monospace; background: #eef2f7; padding: 1px 6px; border-radius: 4px; }

/* 浏览页 tab（岗位/人才） */
.browse-header { display: flex; align-items: flex-end; justify-content: center; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.browse-tabs { display: flex; gap: 0; }
.browse-tab { padding: 10px 40px; font-weight: 800; font-size: 1.1em; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: .15s; user-select: none; }
.browse-tab:hover { color: var(--primary); }
.browse-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* 人才卡片 */
.talent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .talent-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .talent-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .talent-grid { grid-template-columns: 1fr; } }
.talent-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: .15s; }
.talent-card:hover { box-shadow: var(--shadow); border-color: #cfe0ff; }
.talent-head { display: flex; align-items: center; gap: 10px; }
.talent-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #d4e4ff, #ffe2c8); display: flex; align-items: center; justify-content: center; font-size: 1.3em; color: #6b7a90; flex-shrink: 0; }
.talent-name { font-weight: 800; font-size: 1.05em; }
.talent-meta { color: var(--muted); font-size: .82em; margin-top: 2px; }
.talent-tag-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.talent-school { margin-top: 8px; color: var(--ok); font-size: .85em; display: flex; align-items: center; gap: 4px; }

/* 徽标 */
.badge-ok { background: #e7f7ee; color: var(--ok); padding: 2px 8px; border-radius: 12px; font-size: .76em; font-weight: 700; }
.badge-warn { background: #fff3e0; color: var(--warn); padding: 2px 8px; border-radius: 12px; font-size: .76em; font-weight: 700; }
.badge-archived { background: #f0f1f4; color: var(--muted); padding: 2px 8px; border-radius: 12px; font-size: .76em; font-weight: 700; }
.badge-verified { background: #e7f7ee; color: var(--ok); padding: 2px 8px; border-radius: 12px; font-size: .76em; font-weight: 700; border: 1px solid #c2ecd2; }
.badge-unverified { background: #fdeceb; color: var(--danger); padding: 2px 8px; border-radius: 12px; font-size: .76em; font-weight: 700; }

/* Logo 缩略图 */
.logo-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: #f4f7fb; }
.logo-preview { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); margin-top: 6px; }

/* 语音填报：一页多题 */
.voice-list { display: flex; flex-direction: column; gap: 14px; }
.voice-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.voice-q { font-weight: 700; font-size: 1.05em; display: flex; align-items: center; gap: 6px; }
.voice-item .island { background: #f7faff; }

/* ===================== 响应式自适应 ===================== */
/* 平板：≤900px */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 8px 14px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 1.02em; }
  .nav { order: 3; width: 100%; flex: 1 1 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .top-actions { margin-left: auto; }
  .container { margin: 16px auto; padding: 0 14px; }
  .job-card { padding: 12px; }
}

/* 手机：≤600px */
@media (max-width: 600px) {
  :root { --radius: 10px; }
  .topbar { padding: 8px 12px; }
  .brand-name { font-size: .95em; max-width: 60vw; }
  .top-actions .btn-ghost { padding: 6px 10px; font-size: .9em; }
  .container { margin: 12px auto; padding: 0 12px; }
  .page-title { font-size: 1.2em; }
  .page-desc { font-size: .9em; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .toolbar { gap: 8px; }
  /* 工具条内的输入与下拉在手机上占满整行，便于触摸操作 */
  .toolbar input, .toolbar select { width: 100%; min-width: 0; flex: 1 1 100%; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { flex: 1 1 auto; }
  /* 弹层在手机上接近全屏，避免内容被截断 */
  .modal-mask { padding: 0; align-items: stretch; }
  .modal { max-width: 100%; width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; padding: 18px 14px; }
  .modal-actions { position: sticky; bottom: 0; background: #fff; padding-top: 12px; flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 100%; }
  /* 台账表格：横向滚动保留，操作按钮换行 */
  .row-actions { flex-wrap: wrap; }
  .row-actions .btn { flex: 1 1 auto; }
  /* 浏览页 tab */
  .browse-header { flex-direction: column; align-items: stretch; gap: 6px; }
  .browse-tab { padding: 10px 16px; font-size: 1em; }
  .talent-grid { grid-template-columns: 1fr; }
  /* 岗位详情的企业信息与字段两列改为单列 */
  .grid.cols-2 { grid-template-columns: 1fr; }
}

/* 超小屏：≤380px 进一步压缩 */
@media (max-width: 380px) {
  .brand-name { font-size: .82em; }
  .nav a { padding: 6px 8px; font-size: .9em; }
}

/* ===================== 浮动联系模块 ===================== */
.contact-float-wrapper {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 100;
}
.contact-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(31, 111, 235, 0.25);
  transition: .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.contact-trigger:hover {
  transform: scale(1.08);
}
.contact-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 14px;
  min-width: 210px;
  max-width: 280px;
  display: none;
}
.contact-panel.open {
  display: block;
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(227, 233, 240, 0.7);
}
.contact-item:last-child {
  border-bottom: none;
}
.contact-item.contact-item-qrcode {
  align-items: flex-start;
}
.contact-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}
.contact-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.02em;
}
.contact-link:hover {
  text-decoration: underline;
}
.contact-qrcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact-qrcode {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 1px solid rgba(227, 233, 240, 0.8);
  background: rgba(255, 255, 255, 0.7);
}
.contact-qrcode-label {
  font-size: .8em;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}
.contact-empty {
  color: var(--muted);
  font-size: .9em;
  text-align: center;
  padding: 10px;
}

/* 手机端调整 */
@media (max-width: 600px) {
  .contact-float-wrapper {
    right: 12px;
    bottom: 70px;
  }
  .contact-trigger {
    width: 52px;
    height: 52px;
  }
  .contact-panel {
    right: -4px;
    min-width: 190px;
  }
}

/* ===================== Banner轮播 ===================== */
.banner-wrapper {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.banner-container {
  display: flex;
  transition: transform 0.5s ease;
}
.banner-slide {
  min-width: 100%;
  position: relative;
}
.banner-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}
.banner-title {
  position: absolute;
  bottom: 60px;
  left: 30px;
  color: #fff;
  font-size: 1.8em;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.banner-subtitle {
  position: absolute;
  bottom: 30px;
  left: 30px;
  color: #fff;
  font-size: 1em;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.banner-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: .2s;
}
.banner-dot.active {
  background: #fff;
  transform: scale(1.2);
}
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.4);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5em;
  cursor: pointer;
  opacity: 0;
  transition: .2s;
}
.banner-wrapper:hover .banner-arrow {
  opacity: 1;
}
.banner-prev { left: 15px; }
.banner-next { right: 15px; }
.banner-arrow:hover {
  background: rgba(0,0,0,.7);
}

/* 手机端：Banner在导航上方 */
@media (max-width: 600px) {
  .banner-image {
    height: 180px;
  }
  .banner-title {
    font-size: 1.2em;
    bottom: 40px;
    left: 15px;
  }
  .banner-subtitle {
    font-size: .85em;
    bottom: 20px;
    left: 15px;
  }
  .banner-wrapper {
    margin: 0 12px;
    border-radius: 8px;
  }
}
