/* ============================================================
 * 数惠坊 HR 智能平台 · 统一设计系统
 * 门户与招聘 / 盘点 / 系统设置 / 测评 / AI 面试 共用同一套视觉语言
 * 加载顺序：本文件在最前，页面各自的布局样式在后
 * ============================================================ */

/* ---------------- 设计令牌 ---------------- */
:root {
  /* 品牌深蓝：专业感的主色 */
  --brand:    #0f2540;
  --brand-2:  #1c4f80;
  --brand-3:  #2a6ba8;
  /* 科技强调色：电光青 + 靛蓝，仅用于点缀与交互反馈 */
  --accent:   #00c2e0;
  --accent-2: #4f7cff;
  --accent-soft: rgba(0, 194, 224, .12);

  /* 极深底色：登录页与侧边栏 */
  --ink-900:  #050f1e;
  --ink-800:  #0a1a2f;
  --ink-700:  #123154;

  /* 明面 */
  --bg:       #f4f7fc;
  --surface:  #ffffff;
  --surface-2:#fafcfe;
  --line:     #e6ecf3;
  --line-2:   #d5e1ec;

  /* 文字 */
  --text:     #17293d;
  --text-2:   #4a5c71;
  --muted:    #7d90a6;

  /* 语义色 */
  --ok:   #0fae6a;
  --warn: #f0a020;
  --bad:  #e8503f;

  /* 圆角与阴影 */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(15, 37, 64, .05);
  --sh-2: 0 4px 14px rgba(15, 37, 64, .07);
  --sh-3: 0 14px 34px rgba(15, 37, 64, .13);
  --sh-glow: 0 8px 26px rgba(0, 194, 224, .30);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

/* 旧令牌别名：招聘 / 盘点 / 设置三个模块原本各自维护一份 :root，
   现在统一指向上面的主令牌，保证所有模块永远同一套配色 */
:root {
  --primary:   var(--brand);
  --primary-2: var(--brand-2);
  --primary-3: var(--brand-3);
  --brand2:   var(--brand-2);   /* 系统设置模块旧写法 */
  --card:      var(--surface);
  --radius:    var(--r);
  /* 人力盘点：人员身份配色（九宫格名字 / 员工列表 / 图例共用）
     这两个令牌只在盘点模块被引用，之前一直没有定义，导致名字颜色实际不生效 */
  --mgr:       #7c3aed;         /* 管理人员 · 紫 */
  --emp:       #2563eb;         /* 普通员工 · 蓝 */
}

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .2px; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: rgba(0, 194, 224, .25); }

/* 滚动条：细窄、无色块，减少视觉噪音 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cddae6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b3c6d6; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 动效关键帧 ---------------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}
/* 按钮流光：hover 时一道高光扫过 */
@keyframes sheen {
  0%   { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(320%) skewX(-18deg); }
}
/* 呼吸微光：侧边栏激活项、品牌标识 */
@keyframes breathe {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseRing {
  0%   { transform: scale(.85); opacity: .7; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes drawLine {
  from { transform: scaleX(0); } to { transform: scaleX(1); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* 入场：按 nth-child 依次抬升，页面/卡片切换有层次 */
.anim-rise { animation: riseIn .5s cubic-bezier(.22, 1, .36, 1) both; }
.anim-rise:nth-child(1) { animation-delay: .02s; }
.anim-rise:nth-child(2) { animation-delay: .08s; }
.anim-rise:nth-child(3) { animation-delay: .14s; }
.anim-rise:nth-child(4) { animation-delay: .20s; }
.anim-rise:nth-child(5) { animation-delay: .26s; }
.anim-rise:nth-child(6) { animation-delay: .32s; }
.anim-fade { animation: fadeIn .4s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
 * 登录页 · 深色科技风
 * ============================================================ */
#auth-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--ink-900);
  overflow: hidden;
}
/* canvas 动态背景铺满，作为整个登录页的底 */
#tech-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
/* 背景之上的暗角与顶部氛围光 */
#auth-view::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 12% 18%, rgba(0, 194, 224, .16), transparent 62%),
    radial-gradient(760px 460px at 88% 82%, rgba(79, 124, 255, .16), transparent 64%),
    linear-gradient(180deg, rgba(5, 15, 30, .55), rgba(5, 15, 30, .72));
}
.auth-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 44px;
  align-items: center;
}

/* ---- 左侧品牌宣言 ---- */
.auth-brand { color: #eaf3fb; }
.ab-logo {
  display: flex; align-items: center; gap: 11px;
  font-size: 15px; font-weight: 700; letter-spacing: 2px;
  color: #cfe6f4;
}
.ab-mark {
  position: relative;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(0, 194, 224, .35);
}
.ab-mark::before {
  content: "";
  position: absolute; inset: 8px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 3px;
  border-right-color: transparent; border-bottom-color: transparent;
  animation: breathe 3.2s ease-in-out infinite;
}
.ab-title {
  margin: 22px 0 0;
  font-size: 40px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(100deg, #ffffff 12%, #a9e6f5 52%, #b9c9ff 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ab-sub {
  margin: 14px 0 0;
  font-size: 14px;
  color: #9fb6cc;
  letter-spacing: .5px;
}
.ab-line {
  width: 56px; height: 3px; margin: 22px 0 26px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  animation: drawLine .9s .2s cubic-bezier(.22, 1, .36, 1) both;
}
.ab-list { list-style: none; margin: 0; padding: 0; }
.ab-list li {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; color: #b6cadb;
  padding: 7px 0;
}
.ab-list .no {
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: var(--accent);
  width: 26px; flex: none;
  font-variant-numeric: tabular-nums;
}
.ab-foot {
  margin-top: 30px;
  font-size: 12px; color: #6d859c; letter-spacing: .4px;
}

/* ---- 右侧玻璃表单 ---- */
.auth-panel {
  position: relative;
  border-radius: 20px;
  padding: 34px 32px 30px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
/* 顶部一道青色高光边 */
.auth-panel::before {
  content: "";
  position: absolute; top: -1px; left: 26px; right: 26px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .75;
}
.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-size: 19px; color: #fff; letter-spacing: .5px; }
.auth-head p { margin: 5px 0 0; font-size: 12.5px; color: #93abc2; }

/* 登录 / 注册 切换：底部滑动指示条 */
.auth-tabs {
  position: relative;
  display: flex; gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, .07);
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .08);
}
.auth-tabs button {
  position: relative; z-index: 1;
  flex: 1; padding: 9px 0;
  border: none; background: transparent;
  border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600;
  color: #9db4ca;
  font-family: inherit;
  transition: color .22s;
}
.auth-tabs button.on { color: #fff; }
.auth-tabs button:not(.on):hover { color: #d3e3f0; }
.auth-tab-ink {
  position: absolute; z-index: 0;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 8px;
  background: linear-gradient(120deg, var(--brand-3), var(--accent));
  box-shadow: 0 4px 14px rgba(0, 194, 224, .28);
  transition: transform .32s cubic-bezier(.22, 1, .36, 1);
}
.auth-tab-ink[data-at="reg"] { transform: translateX(100%); }

/* 深色版输入框 */
.auth-panel .field { margin-bottom: 15px; }
.auth-panel .field label {
  display: block; font-size: 12px; font-weight: 600;
  margin-bottom: 7px; color: #a9c0d5; letter-spacing: .3px;
}
.auth-panel .field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, .06);
  outline: none;
  transition: border-color .22s, box-shadow .22s, background .22s;
}
.auth-panel .field input::placeholder { color: #6c849b; }
.auth-panel .field input:focus {
  border-color: rgba(0, 194, 224, .65);
  background: rgba(0, 194, 224, .07);
  box-shadow: 0 0 0 3px rgba(0, 194, 224, .14);
}
.auth-link { text-align: right; margin: -4px 0 14px; }
.auth-link a {
  color: #8fd6e8; font-size: 12.5px; cursor: pointer;
  transition: color .2s;
}
.auth-link a:hover { color: #b6ecfa; }
.auth-msg {
  min-height: 20px; font-size: 13px; color: #ff9b8f;
  margin: 8px 0 0; text-align: center;
}
.auth-msg.ok { color: #6ee7b7; }
.auth-hint {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  font-size: 12px; color: #7a93aa; line-height: 1.75;
}

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 26px; max-width: 440px; }
  .auth-brand { text-align: center; }
  .ab-line { margin-left: auto; margin-right: auto; }
  .ab-list { display: none; }
  .ab-title { font-size: 31px; }
  .auth-panel { padding: 28px 24px 24px; }
}

/* ============================================================
 * 通用按钮
 * ============================================================ */
.pbtn {
  position: relative;
  overflow: hidden;
  padding: 10px 18px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 37, 64, .18);
  transition: transform .18s, box-shadow .22s, filter .2s;
}
.pbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 37, 64, .24);
  filter: brightness(1.08);
}
.pbtn:active { transform: translateY(0) scale(.985); }
/* hover 时一道流光扫过 */
.pbtn::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
.pbtn:hover::after { animation: sheen .7s ease; }

.pbtn.ghost {
  background: var(--surface);
  color: var(--brand-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.pbtn.ghost:hover {
  color: var(--brand-2);
  border-color: rgba(0, 194, 224, .55);
  box-shadow: 0 6px 16px rgba(0, 194, 224, .16);
  filter: none;
}
.pbtn.ghost::after { display: none; }
.pbtn.sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; }
.pbtn.lg { padding: 12px 22px; font-size: 15px; }
.pbtn.danger {
  background: var(--surface);
  color: var(--bad);
  border: 1px solid #f6cdc6;
  box-shadow: none;
}
.pbtn.danger:hover {
  background: #fdf3f2; border-color: var(--bad);
  box-shadow: 0 4px 12px rgba(232, 80, 63, .14);
  filter: none;
}
.pbtn.danger::after { display: none; }
.pbtn[disabled], .pbtn.disabled {
  opacity: .5; cursor: not-allowed; transform: none; filter: none;
}
.pbtn[disabled]::after { display: none; }

/* 登录页的主按钮：青蓝渐变，更醒目 */
.auth-panel .pbtn {
  width: 100%;
  padding: 12px 18px;
  font-size: 14.5px;
  letter-spacing: 2px;
  background: linear-gradient(120deg, var(--brand-3), var(--accent));
  box-shadow: 0 6px 20px rgba(0, 194, 224, .28);
}
.auth-panel .pbtn:hover { box-shadow: 0 10px 28px rgba(0, 194, 224, .38); }
.auth-panel .pbtn.ghost {
  background: rgba(255, 255, 255, .08);
  color: #cfe6f4;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: none;
}
.auth-panel .pbtn.ghost:hover {
  background: rgba(255, 255, 255, .13);
  border-color: rgba(0, 194, 224, .5);
  color: #fff;
}

/* 点击涟漪（由 JS 注入 .ripple-wave） */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  transform: scale(0);
  pointer-events: none;
  animation: rippleOut .55s ease-out forwards;
}
@keyframes rippleOut {
  to { transform: scale(2.6); opacity: 0; }
}

/* ============================================================
 * 卡片 / 容器
 * ============================================================ */
.p-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
  transition: box-shadow .25s, border-color .25s, transform .25s;
}
.p-card:hover { box-shadow: var(--sh-2); }
.p-card > h3 {
  display: flex; align-items: center;
  font-size: 15px; color: var(--brand); margin-bottom: 15px;
}
/* 标题左侧一道渐变竖条，替代原来的图标 */
.p-card > h3::before {
  content: "";
  width: 3px; height: 14px; margin-right: 9px; flex: none;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

/* ============================================================
 * 表单
 * ============================================================ */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-2);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(0, 194, 224, .6);
  box-shadow: 0 0 0 3px rgba(0, 194, 224, .12);
}
.field input::placeholder, .field textarea::placeholder { color: #a9b8c8; }

select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1.5L6 6.5L11 1.5' stroke='%237d90a6' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

/* ============================================================
 * 标签
 * ============================================================ */
.p-tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  margin-left: 6px;
  background: var(--accent-soft);
  color: #0a7f9a;
  border: 1px solid rgba(0, 194, 224, .22);
  white-space: nowrap;
}
.p-tag.ok   { background: rgba(15, 174, 106, .10); color: #0b8f5c; border-color: rgba(15, 174, 106, .22); }
.p-tag.warn { background: rgba(240, 160, 32, .12); color: #a86b06; border-color: rgba(240, 160, 32, .24); }
.p-tag.bad  { background: rgba(232, 80, 63, .10);  color: #c9402f; border-color: rgba(232, 80, 63, .22); }
.p-tag.gray { background: #f0f4f8; color: var(--muted); border-color: var(--line); }

/* ============================================================
 * 表格
 * ============================================================ */
.p-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-tbl th {
  text-align: left;
  padding: 11px 13px;
  font-weight: 600;
  color: var(--text-2);
  background: linear-gradient(180deg, #fafcfe, #f4f8fb);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  font-size: 12.5px;
  letter-spacing: .3px;
}
.p-tbl td {
  padding: 12px 13px;
  border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
  transition: background .18s;
}
.p-tbl tbody tr { transition: background .18s; }
.p-tbl tbody tr:hover td {
  background: linear-gradient(90deg, rgba(0, 194, 224, .05), rgba(79, 124, 255, .04));
}
.p-tbl tbody tr:last-child td { border-bottom: none; }

/* ============================================================
 * 空态 / 加载
 * ============================================================ */
.p-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.p-sub  { font-size: 12px; color: var(--muted); }
.p-spin {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #d9e4ee;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}

/* ============================================================
 * 弹窗
 * ============================================================ */
.p-modal {
  position: fixed; inset: 0;
  background: rgba(8, 20, 36, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 90; padding: 20px;
  animation: fadeIn .2s ease both;
}
.p-modal .box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  width: 100%; max-width: 720px;
  max-height: 86vh; overflow: auto;
  box-shadow: 0 28px 70px rgba(8, 20, 36, .30);
  animation: zoomIn .28s cubic-bezier(.22, 1, .36, 1) both;
}
.p-modal h3 {
  display: flex; align-items: center;
  font-size: 17px; color: var(--brand); margin-bottom: 16px;
}
.p-modal h3::before {
  content: "";
  width: 3px; height: 16px; margin-right: 10px; flex: none;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.p-modal .btn-row { display: flex; gap: 9px; }

/* ============================================================
 * Toast
 * ============================================================ */
.p-toast {
  position: fixed;
  left: 50%; bottom: 42px;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand), var(--ink-700));
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 999;
  box-shadow: 0 12px 32px rgba(8, 20, 36, .30);
  border: 1px solid rgba(255, 255, 255, .10);
  animation: toastIn .32s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
 * 徽标按钮组（子导航胶囊）
 * ============================================================ */
.psn, .psn-tabs button {
  font-family: inherit;
}
.psn {
  position: relative;
  padding: 8px 18px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .22s;
}
.psn:hover {
  border-color: rgba(0, 194, 224, .5);
  color: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 194, 224, .12);
}
.psn.on {
  background: linear-gradient(120deg, var(--brand-2), var(--brand-3));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(28, 79, 128, .28);
}
.psn.on:hover { transform: none; }

/* 通用分段切换 */
.as-tabs, .seg { display: flex; gap: 8px; }
.as-tabs button, .seg button {
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  font-family: inherit;
  transition: all .2s;
}
.as-tabs button:hover, .seg button:hover {
  border-color: rgba(0, 194, 224, .5); color: var(--brand-2);
}
.as-tabs button.on, .seg button.on {
  background: linear-gradient(120deg, var(--brand-2), var(--brand-3));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(28, 79, 128, .25);
}
