/* ==========================================================================
   矿农网 · 设计系统 Design Tokens
   西北煤矿 / 化工 / 电力 蓝领垂直招工平台
   两端共用基础层：移动端 H5 工人端 + PC 管理后台
   --------------------------------------------------------------------------
   设计基调：稳重专业 · 工业简约 · 大字清晰 · 克制装饰
   主色 深海蓝 #0F3A80   辅助色 金   白底 + 警示红 + 成功绿
   ========================================================================== */

:root {
  /* ---------- 1. 主色 · 深海蓝 ---------- */
  --blue-950: #061631;
  --blue-900: #0A2A5C;
  --blue-800: #0C3068;
  --blue-700: #0F3A80;   /* 品牌主色 */
  --blue-600: #17509E;
  --blue-500: #2565B8;
  --blue-400: #4C89D2;
  --blue-300: #8DB3E4;
  --blue-200: #C2D8F2;
  --blue-100: #E4EEFA;
  --blue-50:  #F2F7FD;

  /* ---------- 2. 辅助色 · 金 ---------- */
  --gold-700: #8A6414;   /* 浅底上的金色文字（对比达标） */
  --gold-600: #AE7E1A;   /* 薪资数字 */
  --gold-500: #C9992B;   /* 金色基准 · 填充 / 描边 */
  --gold-400: #DEB44F;
  --gold-300: #EDD083;
  --gold-200: #F7E5B4;
  --gold-100: #FCF3DE;
  --gold-50:  #FEFAF0;

  /* ---------- 3. 语义色 ---------- */
  --danger:      #D9342B;   /* 警示红 */
  --danger-600:  #B8271F;
  --danger-100:  #FDE9E7;
  --success:     #178A4C;   /* 成功绿 */
  --success-600: #0F6B3A;
  --success-100: #E6F6EC;
  --warn:        #D98200;
  --warn-100:    #FFF3E0;

  /* ---------- 4. 中性色（冷调，与深海蓝同族） ---------- */
  --ink-900: #101C2E;
  --ink-800: #1E2F47;
  --ink-700: #33445C;
  --ink-600: #4E6178;
  --ink-500: #6B7C93;
  --ink-400: #93A1B5;
  --ink-300: #B8C2D0;

  --line:    #E4EAF2;      /* 分割线 / 卡片描边 */
  --line-2:  #EFF3F8;      /* 更浅的分割 */
  --bg:      #F4F7FB;      /* 页面底色 */
  --surface: #FFFFFF;      /* 卡片 / 容器 */

  /* ---------- 5. 字体 ---------- */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC",
          "Helvetica Neue", Arial, sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "SF Pro Display", "Segoe UI",
              -apple-system, "PingFang SC", sans-serif;

  /* 移动端字阶 —— 偏大，照顾一线工友与年长用户 */
  --t-xs:   12px;
  --t-sm:   14px;
  --t-base: 16px;   /* 正文基准（常规 App 为 14） */
  --t-md:   17px;
  --t-lg:   19px;
  --t-xl:   22px;
  --t-2xl:  26px;
  --t-3xl:  32px;

  /* PC 后台字阶 */
  --d-xs:   12px;
  --d-sm:   13px;
  --d-base: 14px;
  --d-md:   15px;
  --d-lg:   17px;
  --d-xl:   20px;
  --d-2xl:  24px;
  --d-3xl:  30px;

  --lh-tight: 1.25;
  --lh-body:  1.6;

  /* ---------- 6. 间距（4 基数） ---------- */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;

  /* ---------- 7. 圆角（适中，不做卡通） ---------- */
  --r-xs:  4px;
  --r-sm:  6px;
  --r-md:  8px;
  --r-lg:  10px;
  --r-xl:  12px;   /* 移动端卡片 */
  --r-2xl: 16px;
  --r-pill: 999px;

  /* ---------- 8. 阴影（克制） ---------- */
  --sh-1: 0 1px 2px rgba(16, 28, 46, .05);
  --sh-2: 0 2px 8px rgba(15, 58, 128, .07);
  --sh-3: 0 8px 24px rgba(15, 58, 128, .12);
  --sh-4: 0 16px 40px rgba(15, 58, 128, .16);

  /* ---------- 9. 层叠 ---------- */
  --z-tab: 70;
  --z-sticky: 60;
  --z-mask: 90;
  --z-modal: 100;
  --z-toast: 120;

  /* ---------- 10. 触控 ---------- */
  --tap: 48px;      /* 移动端最小触控高度（＞常规 44，戴手套友好） */
}

/* 大字模式（设置 · 显示）：放大整站字阶，照顾年长 / 井下工友。
   ⚠️ 2026-10-15 接入：body.big 由移动端 STATE.set.big 切换（见 mobile.app.js）。
   覆盖 token 字阶变量，所有用 var(--t-*) 的文本随之放大。 */
body.big {
  --t-xs:   13.5px;
  --t-sm:   15.5px;
  --t-base: 18px;
  --t-md:   19px;
  --t-lg:   21px;
  --t-xl:   24px;
  --t-2xl:  28px;
  --t-3xl:  34px;
}

/* ==========================================================================
   基础重置
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { background: var(--bg); }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}

input, select, textarea { font-family: inherit; }

a { color: var(--blue-600); text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, h5, p { margin: 0; }

img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* 数字统一等宽对齐，便于扫读薪资 / 指标
   ⚠️ 2026-10-09：.salary 数字字体从 --font-num（DIN/Bahnschrift）改回正文字体栈 ——
   设计稿（home-hot-10.html 等全套）的薪资数字都是默认字体 + tabular-nums，
   DIN 的窄高形态和设计稿「严重不符」。仪表盘 .metric/.stat/.money 不在本次范围，保留 DIN。 */
.num, .metric b, .stat b, .money {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.salary {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   图标（全部内联 SVG，stroke 跟随 currentColor）
   ========================================================================== */
.ic {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-sm { width: 16px; height: 16px; stroke-width: 1.9; }
/* ⚠️ `.ic-xs` 一直被 mobile 引用（足迹页筛选/清空按钮）却从未定义 —— 补上最小一档 */
.ic-xs { width: 12px; height: 12px; stroke-width: 2.1; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 30px; height: 30px; stroke-width: 1.6; }
.ic-fill { fill: currentColor; stroke: none; }

/* ==========================================================================
   通用组件 · 按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--tap);
  padding: 0 20px;
  border-radius: var(--r-lg);
  font-size: var(--t-base);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, transform .08s;
  line-height: 1;
}
.btn:active { transform: scale(.985); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.btn-primary  { background: var(--blue-700); color: #fff; }
.btn-primary:active { background: var(--blue-800); }

.btn-gold     { background: var(--gold-500); color: #4A3406; }
.btn-gold:active { background: var(--gold-600); color: #fff; }

.btn-danger   { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }

.btn-line     { background: #fff; color: var(--blue-700); border: 1.5px solid var(--blue-200); }
.btn-line:active { background: var(--blue-50); }

.btn-ghost    { background: var(--blue-50); color: var(--blue-700); }
.btn-ghost:active { background: var(--blue-100); }

.btn-plain    { background: #fff; color: var(--ink-700); border: 1.5px solid var(--line); }
.btn-plain:active { background: var(--line-2); }

.btn-sm { height: 36px; padding: 0 14px; font-size: var(--t-sm); border-radius: var(--r-md); }
.btn-lg { height: 52px; padding: 0 26px; font-size: var(--t-md); }
.btn-block { display: flex; width: 100%; }

/* 底部固定操作条
   招聘/找活/需求详情页的「联系栏」需常驻屏底：本组件是 .screen 的最后一个子元素、
   而 .screen 位于滚动容器 .app-body 内，故用 position:sticky + bottom:0 钉在滚动视口底部
   （与 .navbar 的 sticky top:0 对称）。滚到页尾时回归文档流自然位置，不遮挡正文末尾。 */
.actionbar {
  flex: none;
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(15, 58, 128, .05);
}
.actionbar .ab-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: var(--t-xs);
  color: var(--ink-500);
  min-width: 46px;
  padding: 2px 0;
}
.actionbar .ab-icon .ic { width: 21px; height: 21px; }

/* ==========================================================================
   通用组件 · 标签 / 徽标 / 角标
   ========================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  background: var(--line-2);
  color: var(--ink-600);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}
.chip .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.chip.lg { height: 30px; padding: 0 11px; font-size: var(--t-sm); border-radius: var(--r-sm); }
/* ⚠️ `.chip-sm` 一直被 mobile 引用却从未定义（足迹页"名片 / 需求"小标因此与正文 chip 同高）—— 补上小一档 */
.chip-sm { height: 20px; padding: 0 7px; }

.chip-brand  { background: var(--blue-100); color: var(--blue-700); }
.chip-gold   { background: var(--gold-100); color: var(--gold-700); }
.chip-danger { background: var(--danger-100); color: var(--danger-600); }
.chip-success{ background: var(--success-100); color: var(--success-600); }
.chip-warn   { background: var(--warn-100); color: #A96200; }
.chip-line   { background: #fff; border: 1px solid var(--line); color: var(--ink-600); }
.chip-solid  { background: var(--blue-700); color: #fff; }
.chip-golds  { background: var(--gold-500); color: #4A3406; }

/* 角标（急招等） */
.stamp {
  position: absolute;
  top: 0; right: 0;
  height: 22px;
  padding: 0 9px;
  border-radius: 0 var(--r-xl) 0 var(--r-md);
  font-size: var(--t-xs);
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
}
.stamp-danger { background: var(--danger); }
.stamp-gold   { background: var(--gold-500); color: #4A3406; }
.stamp-brand  { background: var(--blue-700); }

/* ==========================================================================
   通用组件 · 卡片
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 14px;
  box-shadow: var(--sh-1);
}
.card.pad0 { padding: 0; overflow: hidden; }
.card-tight { padding: 12px; }

/* 段落标题 */
.sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 2px 10px;
}
.sec-head .bar {
  width: 3px; height: 15px;
  border-radius: 2px;
  background: var(--blue-700);
  flex: none;
}
.sec-head h3 {
  font-size: var(--t-md);
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: .2px;
}
.sec-head .more {
  margin-left: auto;
  font-size: var(--t-sm);
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}
.sec-head .more .ic { width: 14px; height: 14px; }

/* 通用行（列表项） */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  min-height: 60px;
}
.row + .row { border-top: 1px solid var(--line-2); }
.row-ic {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--blue-50);
  color: var(--blue-700);
  display: grid;
  place-items: center;
  flex: none;
}
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-size: var(--t-base);
  font-weight: 600;
  color: var(--ink-900);
}
.row-desc {
  font-size: var(--t-sm);
  color: var(--ink-500);
  margin-top: 3px;
  line-height: 1.45;
}
.row.link:active { background: var(--blue-50); }
.row .ic-sm:last-child { color: var(--ink-400); }

/* ==========================================================================
   通用组件 · 薪资高亮（全平台重点信息）
   ========================================================================== */
.salary {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: var(--gold-600);
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.1;
}
.salary .u {
  font-size: .58em;
  font-weight: 700;
  margin-left: 1px;
  letter-spacing: 0;
}
.salary-xl { font-size: 30px; }
.salary-lg { font-size: 24px; }
.salary-md { font-size: 19px; }
.salary-sm { font-size: 16px; }
/* 深色底上的薪资 */
.on-dark .salary { color: var(--gold-300); }

/* ==========================================================================
   通用组件 · 表单元素（PC 后台与移动端共用）
   ========================================================================== */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  font-size: var(--d-base);
  color: var(--ink-900);
  transition: border-color .15s;
}
.field:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.field input, .field select {
  border: 0; outline: 0; background: none;
  width: 100%; font-size: inherit; color: inherit;
}
.field .prefix { color: var(--ink-400); font-size: var(--d-sm); flex: none; }

/* 开关 */
.switch {
  width: 42px; height: 24px;
  border-radius: var(--r-pill);
  background: var(--ink-300);
  position: relative;
  flex: none;
  transition: background-color .18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-1);
  transition: transform .18s;
}
.switch.on { background: var(--blue-700); }
.switch.on::after { transform: translateX(18px); }

/* 复选框 */
.cbx {
  width: 20px; height: 20px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--ink-300);
  background: #fff;
  display: grid;
  place-items: center;
  flex: none;
  color: transparent;
}
.cbx.on { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.cbx .ic { width: 13px; height: 13px; stroke-width: 3; }

/* ==========================================================================
   通用组件 · 图片占位（工业纹理，替代真实照片）
   ========================================================================== */
.pic {
  background-color: var(--blue-100);
  background-image:
    linear-gradient(135deg, rgba(15, 58, 128, .10) 25%, transparent 25%, transparent 50%,
                    rgba(15, 58, 128, .10) 50%, rgba(15, 58, 128, .10) 75%, transparent 75%),
    linear-gradient(135deg, var(--blue-100), var(--blue-200));
  background-size: 12px 12px, 100% 100%;
  position: relative;
  overflow: hidden;
}
.pic::after {
  content: attr(data-l);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--blue-600);
  letter-spacing: 1px;
  opacity: .7;
}

/* ==========================================================================
   通用组件 · 图片选择（发布找活 / 需求 / 岗位共用，四端同一套）
   ========================================================================== */
.ipk { margin-top: 4px; }
.ipk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.ipk-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--blue-50);
  border: 1px solid var(--line-2);
}
.ipk-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ipk-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(10, 42, 92, .74);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ipk-del .ic { width: 12px; height: 12px; }
.ipk-add {
  aspect-ratio: 1 / 1;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink-500);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, background .15s;
}
.ipk-add .ic { width: 20px; height: 20px; color: var(--blue-500); }
.ipk-add b { font-size: var(--t-xs); font-weight: 700; color: var(--ink-700); }
.ipk-add small { font-size: 11px; color: var(--ink-400); }
.ipk-add:hover { border-color: var(--blue-500); background: var(--blue-50); }
.ipk-file { display: none; }
.ipk-note {
  margin-top: 8px;
  font-size: var(--t-xs);
  color: var(--ink-400);
}

/* 后台系抽屉（企业端 / 求职端 / 门户）更宽，一行放 6 格 */
.ipk-a .ipk-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

/* ---------- 实拍图片画廊（需求 / 找活名片 / 岗位详情共用） ---------- */
.kgal {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.kg {
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--blue-50);
  cursor: zoom-in;
}
.kg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kg-tip {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 10px;
  font-size: var(--t-xs);
  color: var(--ink-400);
  line-height: 1.5;
}
.kg-tip .ic { flex: none; margin-top: 2px; }

/* ---------- 大图预览（点详情页小图放大，点遮罩任意处关闭） ---------- */
.kn-lb {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  padding: 28px;
  background: rgba(6, 20, 44, .86);
  cursor: zoom-out;
}
.kn-lb.on { display: grid; place-items: center; }
.kn-lb-in { max-width: min(860px, 92vw); }
.kn-lb-in img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.kn-lb-in p {
  margin-top: 12px;
  text-align: center;
  font-size: var(--t-sm);
  color: #D8E4F5;
}

/* ==========================================================================
   滚动条（PC 后台）
   ========================================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #C8D2E0;
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #A9B6C8; background-clip: content-box; }
