/* ===========================================================
   公务员报考专业目录查询 · 山西华图
   白底 + 单一红强调（华图红 #C8102E）+ 细线分隔
   =========================================================== */

:root {
  --red: #C8102E;
  --red-dark: #A00D24;
  --red-soft: #FDECEE;
  --ink: #1F2329;
  --ink-2: #5A6270;
  --ink-3: #8B93A1;
  --line: #E6E9EE;
  --line-2: #F1F3F7;
  --bg-soft: #F7F8FA;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(31, 35, 41, .04), 0 1px 3px rgba(31, 35, 41, .03);
  --shadow-md: 0 6px 18px rgba(31, 35, 41, .07);
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: #fff;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
img { display: block; }

/* ---------------- 顶部 · 标准华图顶栏（真 logo） ---------------- */
.ht_top {
  width: 100%;
  overflow: hidden;
  background: #fafafa url(https://www.huatu.com/z/topfooter/images/nav_bg.gif) repeat-x 0 0;
  line-height: 41px;
}
.ht_top .zt_top { max-width: 1200px; height: 41px; margin: 0 auto; padding: 0 20px; }
.ht_top .zthinkLogo { float: left; }
.ht_top .zthinkLogo a {
  float: left;
  width: 131px; height: 40px; overflow: hidden;
  background: url(https://www.huatu.com/z/topfooter/images/logo.gif) no-repeat;
  font-size: 12px; text-indent: -100em;
}
.ht_top .topnav { float: right; color: #333; font-size: 12px; }
.ht_top .topnav a { position: relative; padding: 0 8px; color: var(--ink-2); }
.ht_top .topnav a:hover { color: var(--red); text-decoration: underline; }
.ht_top .topnav a:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 12px; background: var(--line);
}

/* ---------------- 版心 ---------------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px 60px; }

/* ---------------- 页首 ---------------- */
.hero {
  margin: 26px 0 0;
  padding: 40px 0 34px;
  background: #fff;
  border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.hero-tag {
  display: inline-block;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px; font-weight: 700; letter-spacing: .8px;
  padding: 4px 12px; border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 34px; line-height: 1.25; letter-spacing: -.6px;
  font-weight: 700; color: var(--ink);
}
.hero h1 b { color: var(--red); font-weight: 700; }
.hero-lead {
  margin-top: 14px;
  font-size: 14px; color: var(--ink-2);
  max-width: 640px;
}
.hero-lead b { color: var(--red); }

/* ---------------- 搜索 ---------------- */
.search-section { margin-top: 26px; }
.search-box { display: flex; gap: 12px; align-items: center; }
.search-input {
  flex: 1;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 18px;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-soft);
  outline: none;
  transition: border-color .2s, background-color .2s;
}
.search-input::placeholder { color: var(--ink-3); font-size: 14px; }
.search-input:focus { border-color: var(--red); background: #fff; }

.search-btn {
  flex: none;
  height: 52px;
  padding: 0 34px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: background-color .2s;
}
.search-btn:hover { background: var(--red-dark); }

/* ---------------- 筛选栏 ---------------- */
.filter-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.level-tabs { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tab-btn {
  padding: 8px 22px;
  border: none;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.tab-btn:not(:last-child) { border-right: 1px solid var(--line); }
.tab-btn:hover { color: var(--red); }
.tab-btn.active { background: var(--red); color: #fff; font-weight: 700; }

.discipline-select {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
  min-width: 168px;
}
.discipline-select:focus { border-color: var(--red); }

.result-count { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.result-count strong { color: var(--red); font-size: 16px; font-weight: 700; }

/* ---------------- 结果表格 ---------------- */
.result-section { margin-top: 22px; }

.table-header {
  display: grid;
  grid-template-columns: 90px 1.2fr 0.9fr 1fr 1fr;
  background: var(--bg-soft);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.th { padding: 13px 14px; text-align: left; }
.th-code { text-align: center; }
.th-tip {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 1px;
}

.table-body { max-height: 620px; overflow-y: auto; }

.table-row {
  display: grid;
  grid-template-columns: 90px 1.2fr 0.9fr 1fr 1fr;
  border-bottom: 1px solid var(--line-2);
  transition: background-color .15s;
}
.table-row:hover { background: var(--bg-soft); }
.table-row:last-child { border-bottom: none; }

.td {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  min-width: 0;          /* 允许 grid 列收缩，避免被长内容撑开挤扁其他列 */
}
.td-code {
  justify-content: center;
  color: var(--ink-3);
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  cursor: pointer;
  transition: color .15s;
}
.td-code:hover { color: var(--red); }
/* 税务目录内、教育部目录未列代码的专业 */
.td-code-empty { cursor: default; color: var(--ink-3); opacity: .55; }
.td-code-empty:hover { color: var(--ink-3); }
/* 某一维度没有数据时的占位（两个维度各自独立，缺的显示「—」） */
.td-empty { color: var(--ink-3); opacity: .5; }
.td-name { font-weight: 700; color: var(--ink); flex-wrap: wrap; column-gap: 7px; }
/* 名称后的标签统一用 column-gap 控制间距，去掉各自的 margin-left */
.td-name .src-tag, .td-name .lv-tag, .td-name .lv-limit, .td-name .field-toggle, .td-name .field-parent { margin-left: 0; }
.td-discipline { color: var(--red); font-weight: 700; }
.td-category { color: var(--ink-2); }
/* 类名后的 4 位专业类代码（与职位表写法对齐） */
.cat-code {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 12px;
  color: var(--ink-3);
}
/* 移动端「专业二级分类」列被隐藏时，类代码在名称列兜底显示 */
.cat-code-mob { display: none; }
.td-tax { color: #B8860B; font-weight: 500; }
.td-tax[data-empty] { color: var(--ink-3); font-weight: 400; }

/* ---------------- 专业领域（研究生段 · 专业学位类别下设） ---------------- */
/* 类别行上的「专业领域 N」开关 */
.field-toggle {
  margin-left: 7px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.7;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, border-color .15s, background-color .15s;
}
.field-toggle:hover { border-color: var(--red); color: var(--red); }
.field-toggle.is-open { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.field-toggle .ft-arrow { margin-left: 3px; font-size: 10px; }

/* 领域行的层级标签 */
.lv-tag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  vertical-align: 1px;
  white-space: nowrap;
}

/* 层次标签：官方“名称后加 * 的仅限硕士层次”／注释里的“仅限博士层次” */
.lv-limit {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #EDF2F7;
  color: #5A6B7C;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  vertical-align: 1px;
  white-space: nowrap;
}

/* 领域行：浅底 + 代码列加「└」缩进标记，视觉上从属于上方类别 */
.row-field { background: #FCFAF7; }
.row-field:hover { background: var(--bg-soft); }
.row-field .td-code::before {
  content: "└";
  margin-right: 5px;
  color: var(--ink-3);
  opacity: .6;
  font-family: inherit;
}
.row-field .td-name { font-weight: 600; }
.row-field .td-category { color: var(--ink-3); }

/* 所属类别：桌面端由「专业二级分类」列显示，移动端该列隐藏时用这里的兜底 */
.field-parent { display: none; font-size: 12px; color: var(--ink-3); margin-left: 7px; }

/* 空状态里的「切到 X 查看」跨学历跳转 */
.level-jump {
  margin-left: 6px;
  padding: 2px 10px;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.level-jump:hover { background: var(--red); color: #fff; }
.empty-hint-jump { color: var(--ink-2); }

/* 关键词高亮 */
.highlight {
  background: var(--red-soft);
  color: var(--red);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 700;
}

/* ---------------- 空状态 ---------------- */
.empty-state { display: none; padding: 64px 20px; text-align: center; border-top: 1px solid var(--ink); }
.empty-state.is-visible { display: block; }
.empty-text { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.empty-hint { font-size: 13px; color: var(--ink-3); }
.empty-hint-sub { margin-top: 18px; }

/* 相近专业推荐 */
.similar-list {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 18px;
}
.similar-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background-color .15s;
}
.similar-item:hover { border-color: var(--red); background: var(--red-soft); }
.similar-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.similar-item:hover .similar-name { color: var(--red); }
.similar-meta { font-size: 12px; color: var(--ink-3); font-family: "Consolas", "Monaco", monospace; }

/* ---------------- 留资：悬浮按钮 + 弹窗 ---------------- */
.fab {
  position: fixed; right: 26px; bottom: 84px; z-index: 900;
  border: none; background: var(--red); color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 14px 22px; border-radius: 999px;
  box-shadow: 0 10px 24px rgba(200, 16, 46, .32);
  cursor: pointer;
  transition: background-color .2s;
}
.fab:hover { background: var(--red-dark); }

.modal-mask {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(31, 35, 41, .5);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.lead-box {
  position: relative; width: 100%; max-width: 400px; text-align: center;
  background: #fff; border-radius: var(--radius); padding: 32px 30px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .24);
}
.lead-box .close {
  position: absolute; right: 16px; top: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 20px; line-height: 29px; cursor: pointer; text-align: center;
}
.lead-box .close:hover { background: var(--red-soft); color: var(--red); }
.lead-tag {
  display: inline-block; background: var(--red); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 4px 14px; border-radius: 999px; margin-bottom: 14px;
}
.lead-box h3 { font-size: 18px; margin-bottom: 10px; padding: 0 8px; line-height: 1.5; }
#lead-target { font-size: 13px; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.lead-sub { font-size: 13px; color: var(--ink-2); line-height: 1.85; }
.lead-sub b { color: var(--red); }
.lead-box .qr { margin: 18px auto 10px; width: 190px; }
.lead-box .qr img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: #fff; }
.lead-box .tip { font-size: 12px; color: var(--ink-3); }

/* ---------------- 免责说明 + 标准页脚 ---------------- */
.foot-note {
  text-align: center; font-size: 12px; color: var(--ink-3);
  padding: 26px 20px 0; border-top: 1px solid var(--line); margin-top: 48px;
}
.footer { border-top: 1px solid var(--line); margin-top: 16px; background: var(--bg-soft); padding: 22px 20px; text-align: center; }
.footer p { font-size: 12px; color: var(--ink-3); line-height: 2; }
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--red); }

/* ---------------- 返回顶部 ---------------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 900;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  font-size: 18px; line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  box-shadow: var(--shadow-sm);
  transition: color .2s, border-color .2s;
}
.to-top.show { display: block; }
.to-top:hover { color: var(--red); border-color: var(--red); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 16px);
  z-index: 1200; max-width: 84vw;
  background: rgba(31, 35, 41, .92); color: #fff;
  font-size: 14px; padding: 12px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 滚动条 ---------------- */
.table-body::-webkit-scrollbar { width: 6px; }
.table-body::-webkit-scrollbar-track { background: var(--line-2); }
.table-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.table-body::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 768px) {
  .hero { padding: 28px 0 26px; }
  .hero h1 { font-size: 26px; }
  .hero-lead { font-size: 13px; }

  .search-box { flex-direction: column; align-items: stretch; }
  /* ⚠️ column 方向下 flex:1 会变成纵向伸展（flex-basis:0 → 高度塌缩），必须重置 */
  .search-input { flex: none; width: 100%; }
  .search-btn { width: 100%; }

  .filter-section { gap: 12px; }
  .level-tabs { width: 100%; }
  .tab-btn { flex: 1; padding: 8px 0; }
  .discipline-select { width: 100%; }
  .result-count { margin-left: 0; width: 100%; text-align: center; }

  /* 移动端隐藏「专业二级分类」列，保留税务类别 */
  .table-header, .table-row { grid-template-columns: 60px 1fr 0.75fr 0.85fr; }
  .th-category, .td-category { display: none; }
  /* 该列隐藏后，「专业领域」行的所属类别改用名称后的兜底元素显示 */
  .field-parent { display: inline; }
  /* 名称列：允许标签换行聚合（名称一行 + 标签一行），避免窄列把名称挤成竖排 */
  .td-name { flex-wrap: wrap; align-items: center; row-gap: 3px; }
  /* 「专业二级分类」列隐藏时，类名+类代码在名称列兜底显示 */
  .cat-code-mob { display: inline; font-size: 12px; color: var(--ink-3); }
  .th, .td { padding: 11px 8px; font-size: 13px; }
  .td-code { font-size: 12px; }
  .th-tip { display: none; }
  .similar-list { flex-direction: column; }
  .similar-item { width: 100%; }

  .fab { right: 16px; bottom: 76px; padding: 12px 18px; font-size: 13px; }
  .to-top { right: 16px; bottom: 22px; width: 40px; height: 40px; }
}

/* ===========================================================
   目录来源：筛选按钮 + 行内徽标 + 底部说明
   =========================================================== */

/* ---------- 来源筛选 ---------- */
.source-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.src-btn {
  padding: 8px 16px;
  border: none;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.src-btn:not(:last-child) { border-right: 1px solid var(--line); }
.src-btn:hover { color: var(--red); }
.src-btn.active { background: var(--bg-soft); color: var(--red); font-weight: 700; }

/* ---------- 行内来源徽标 ---------- */
.src-tag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  vertical-align: 1px;
  white-space: nowrap;
}
.src-both { background: var(--red-soft); color: var(--red); }
.src-edu { background: var(--bg-soft); color: var(--ink-3); }
.src-tax { background: #FDF6E3; color: #B8860B; }
.src-voc { background: #EAF4EE; color: #2F7D4F; }

/* ---------- 说明块（在 hero 内、搜索框上方） ---------- */
.note-box {
  margin: 22px 0 20px;
  padding: 18px 22px;
  background: var(--bg-soft);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
}
.note-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  padding-left: 0;
  border-left: none;
}
.note-box p { margin-bottom: 9px; line-height: 1.95; }
.note-box b { color: var(--ink); }
/* 说明块里的要点列表（比整段文字更紧凑，手机上更快见到搜索框） */
.note-list { margin: 0 0 10px; padding-left: 19px; }
.note-list li { margin-bottom: 5px; line-height: 1.85; color: var(--ink-2); }
.note-list li b { color: var(--ink); }
.note-quote {
  padding: 12px 16px;
  border-left: 3px solid var(--red);
  background: var(--bg-soft);
  color: var(--ink-2);
}

@media (max-width: 768px) {
  .source-tabs { width: 100%; }
  .src-btn { flex: 1; padding: 8px 4px; font-size: 12px; }
  .note-box { font-size: 12.5px; }
}

/* ===========================================================
   底部留资条（参考 sxsklnfsx 的样式；类名用 lead-bar，
   避免与右下弹窗的 .lead-box 冲突）
   =========================================================== */
.lead-bar {
  margin-top: 40px;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #FFF5F5, #FDE8E8);
  border: 1px solid #F0C8CA;
  border-radius: var(--radius-sm);
}
.lead-bar-info { flex: 1 1 320px; }
.lead-bar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
  line-height: 1.4;
}
.lead-bar-sub {
  color: var(--ink-2);
  font-size: 13px;
  max-width: 520px;
  line-height: 1.75;
}
.lead-bar-qr { flex: none; text-align: center; }
.lead-bar-qr img {
  width: 140px; height: 140px;
  border: 1px solid #F0C8CA;
  border-radius: 6px;
  padding: 6px;
  background: #fff;
  display: block;
  box-sizing: border-box;
}
.lead-bar-tip {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 1px;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .lead-bar { padding: 22px 18px; }
  .lead-bar-title { font-size: 17px; }
  .lead-bar-qr { width: 100%; }
  .lead-bar-qr img { width: 120px; height: 120px; margin: 0 auto; }
}
