/* =========================================================================
 * base.css — 全局基础：栅格 / 排版 / 按钮 / 卡片 / 输入框 / 导航 / 页脚 / 状态标签
 * 复用 design-spec.md 第 3–6 节组件定义，移动端三铁律在 §768 / §390 媒体查询落地。
 * ========================================================================= */

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--c-text-2);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 容器与栅格 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid { display: grid; gap: var(--s-24); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 区块通用纵向节奏 */
.section { padding-block: var(--s-64); }
.section-sm { padding-block: var(--s-48); }

/* ---------- 排版 ---------- */
h1, h2, h3, h4 { color: var(--c-text); font-weight: var(--w-bold); line-height: 1.3; margin: 0; }
.h1 { font-size: var(--fs-h1); letter-spacing: -.5px; }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); font-weight: var(--w-medium); }
.caption { font-size: var(--fs-caption); color: var(--c-text-3); }
.lead { font-size: 17px; color: var(--c-text-2); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto var(--s-48); }
.section-head .h2 { margin-bottom: var(--s-12); }
.section-head p { margin: 0; color: var(--c-text-2); }

/* ---------- 按钮（复用 design-spec 第 5 节） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8);
  font-size: var(--fs-body); font-weight: var(--w-medium);
  border: 1px solid transparent; padding: 12px 24px; min-height: 46px;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {                      /* 橙填充白字胶囊 */
  background: var(--c-primary); color: #fff; border-radius: var(--r-pill);
  box-shadow: var(--sh-card);
}
.btn-primary:hover { background: var(--c-primary-press); }
.btn-secondary {                    /* 白底橙描边 */
  background: #fff; color: var(--c-primary); border-color: var(--c-primary);
  border-radius: var(--r-btn);
}
.btn-secondary:hover { background: var(--c-primary-soft); }
.btn-text {                         /* 文字按钮 */
  background: transparent; color: var(--c-primary); padding: 12px 8px; min-height: 0;
}
.btn-text:hover { color: var(--c-primary-press); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ---------- 卡片（复用 design-spec 第 5 节） ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: var(--s-24);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card-hover:hover { box-shadow: var(--sh-card-hover); transform: translateY(-2px); }

/* ---------- 标签 / Chip（认证绿 / 活动橙） ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-pill);
  font-size: var(--fs-caption); font-weight: var(--w-medium); line-height: 1.4;
  white-space: nowrap;
}
.chip-green { background: var(--c-accent-soft); color: var(--c-accent); }
.chip-orange { background: var(--c-primary-soft); color: var(--c-primary); }

/* ---------- 状态标签 4 色（严格按 recruit-spec / design-notes） ---------- */
.st {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-caption); font-weight: var(--w-medium); white-space: nowrap;
}
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-pending   { color: var(--st-pending);   background: rgba(154,142,132,.12); }
.st-reviewing { color: var(--st-reviewing); background: var(--c-primary-soft); }
.st-approved  { color: var(--st-approved);  background: var(--c-accent-soft); }
.st-rejected  { color: var(--st-rejected);  background: rgba(232,163,61,.14); }

/* ---------- 表单控件（复用 design-spec 表单组件） ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-8); margin-bottom: var(--s-16); }
.field > label { font-size: var(--fs-body); font-weight: var(--w-medium); color: var(--c-text); }
.field .req { color: var(--c-primary); margin-left: 2px; }
.field .hint { font-size: var(--fs-caption); color: var(--c-text-3); }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: var(--fs-body); color: var(--c-text);
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-input);
  padding: 12px 14px; line-height: 1.5; transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { resize: vertical; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--c-text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: var(--c-warn); }
.field-error { font-size: var(--fs-caption); color: var(--c-primary-press); min-height: 16px; }

/* 单选组（是否接受培训） */
.radio-row { display: flex; gap: var(--s-12); flex-wrap: wrap; }
.radio-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--c-line); border-radius: var(--r-pill);
  padding: 10px 18px; cursor: pointer; color: var(--c-text-2); background: #fff;
  transition: border-color .15s, background .15s, color .15s;
}
.radio-pill input { accent-color: var(--c-primary); }
.radio-pill:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); }

/* ---------- 吸顶导航（design-spec 第 5 节） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--c-line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-24); min-height: 64px;
  /* 移动端三铁律①：严禁折行/拆行 */
  flex-wrap: nowrap; white-space: nowrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: var(--w-bold); color: var(--c-text); font-size: 18px; flex: 0 0 auto; }
.brand .brand-dot { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); flex: 0 0 auto; }
.brand .brand-sub { color: var(--c-accent); font-weight: var(--w-medium); }

.nav-menu { display: flex; align-items: center; gap: var(--s-24); flex: 1 1 auto; justify-content: center; min-width: 0; }
.nav-menu a { color: var(--c-text-2); font-size: var(--fs-body); font-weight: var(--w-medium); padding: 8px 4px; position: relative; }
.nav-menu a:hover, .nav-menu a.active { color: var(--c-primary); }
.nav-menu a.active::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 2px; background: var(--c-primary); border-radius: 2px; }

.nav-actions { display: flex; align-items: center; gap: var(--s-16); flex: 0 0 auto; }
.nav-phone { color: var(--c-text); font-weight: var(--w-bold); font-family: var(--font-en); white-space: nowrap; }

/* 汉堡按钮：桌面隐藏，移动显示 */
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--c-line); border-radius: 10px;
  background: #fff; align-items: center; justify-content: center; flex: 0 0 auto;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--c-text); border-radius: 2px; position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* 移动展开菜单面板 */
.nav-panel { display: none; }
.nav-panel.open { display: block; border-top: 1px solid var(--c-line); background: #fff; }
.nav-panel ul { padding: var(--s-8) var(--gutter) var(--s-16); }
.nav-panel li { border-bottom: 1px solid var(--c-line); }
.nav-panel li:last-child { border-bottom: none; }
.nav-panel a { display: block; padding: 14px 0; color: var(--c-text-2); font-weight: var(--w-medium); }
.nav-panel .nav-phone { padding: 14px 0; display: block; }

/* ---------- CTA 预约带（design-spec 第 6 节 + recruit-design-notes §四） ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--c-primary), var(--c-accent));
  border-radius: var(--r-card); color: #fff;
  padding: var(--s-32) var(--s-48);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-24);
  box-shadow: var(--sh-card);
}
.cta-band .cta-text h3 { color: #fff; margin-bottom: 4px; }
.cta-band .cta-text p { margin: 0; color: rgba(255,255,255,.9); font-size: var(--fs-body); }
.cta-band .cta-actions { display: flex; align-items: center; gap: var(--s-16); flex: 0 0 auto; }
.cta-band .btn-onband {
  background: #fff; color: var(--c-primary); border-radius: var(--r-pill);
  padding: 12px 24px; font-weight: var(--w-bold); white-space: nowrap;
}
.cta-band .btn-onband:hover { background: var(--c-primary-soft); }
.cta-band .chip-onband { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- 页脚（design-spec 第 6 / 7 节，深棕底 + 暖白字） ---------- */
/* 2026-10-30 交互优化：链接 color 过渡 / 悬停转主橙（与顶部导航一致）/
 * 当前页高亮 .active / 键盘焦点环 :focus-visible / 联系列 SVG 图标对齐 / 预约 CTA */
.site-footer { background: var(--c-footer-bg); color: var(--c-footer-text); padding-block: var(--s-48) var(--s-24); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s-32); }
.site-footer h4 { color: #fff; font-size: var(--fs-body); margin-bottom: var(--s-16); }
.site-footer a { color: rgba(255,249,245,.78); font-size: var(--fs-body); display: inline-block; padding: 4px 0; transition: color .15s ease; }
.site-footer a:hover { color: var(--c-primary); }
.site-footer a:active { color: var(--c-primary-press); }
.site-footer a.active { color: var(--c-primary); font-weight: var(--w-medium); }
.site-footer a:focus-visible, .nav-menu a:focus-visible, .nav-panel a:focus-visible, .nav-toggle:focus-visible {
  outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
.site-footer p .svg-ic { vertical-align: -3px; margin-right: 6px; opacity: .85; }
/* 列内导航链接逐行堆叠（修复 inline 横排挤压成一串）；
 * :not() 排除品牌行（需保持 flex 让圆点有宽）与 CTA（需保持 .btn 的 inline-flex） */
.site-footer .footer-grid div > a:not(.footer-brand):not(.footer-cta) { display: block; }
/* 预约 CTA：恢复按钮内边距（被 .site-footer a 的 4px 覆盖过） */
.site-footer a.footer-cta { padding: 12px 28px; }
.site-footer .footer-brand { font-weight: var(--w-bold); font-size: 18px; color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-12); }
.site-footer .footer-brand .brand-dot { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); }
.site-footer p { margin: 6px 0; color: rgba(255,249,245,.7); font-size: var(--fs-body); }
.footer-bottom { border-top: 1px solid rgba(255,249,245,.12); margin-top: var(--s-32); padding-top: var(--s-24); font-size: var(--fs-caption); color: rgba(255,249,245,.6); }
.footer-bottom .icp { color: rgba(255,249,245,.6); }

/* ---------- 通用工具 ---------- */
.muted { color: var(--c-text-2); }
.center { text-align: center; }
.stack-8 > * + * { margin-top: var(--s-8); }
.stack-16 > * + * { margin-top: var(--s-16); }

/* =========================================================================
 * 响应式：断点 768（平板/移动通用）与 390（手机，三铁律重点）
 * 基准为桌面 ≥769。
 * ========================================================================= */

/* §768：平板及以下 */
@media (max-width: 768px) {
  :root { --gutter: 16px; }
  .section { padding-block: var(--s-48); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* 导航折叠为汉堡，隐藏桌面菜单与内联动作 */
  .nav-menu, .nav-actions { display: none; }
  .nav-toggle { display: inline-flex; }

  .cta-band { flex-direction: column; align-items: flex-start; padding: var(--s-24); }
  .cta-band .cta-actions { width: 100%; flex-wrap: wrap; }   /* 2026-10-31 修 390 横向溢出：chip+双按钮换行 */
  .cta-band .btn-onband { flex: 1; text-align: center; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  /* 触控目标加大：页脚链接行高 ≥ 40px（原 4px 上下留白偏小） */
  .site-footer a { padding: 8px 0; }
}

/* §390：手机，移动端三铁律严格落地 */
@media (max-width: 390px) {
  :root { --gutter: 16px; }
  .h1 { font-size: 30px; }
  .h2 { font-size: 23px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }   /* 铁律②：卡片单列 */

  /* 铁律①：导航折叠汉堡，严禁折行/拆行（头部对齐不变） */
  .nav-inner { gap: var(--s-12); }
  .brand { font-size: 16px; }
  .brand .brand-sub { display: none; }

  .cta-band { padding: var(--s-20); }
  .footer-grid { grid-template-columns: 1fr; }
  /* 预约 CTA 单列满宽，拇指易触达 */
  .site-footer .footer-cta { display: block; width: 100%; text-align: center; padding: 12px 24px; }
}
