/* ============================================================
 * 数惠坊 HR 智能平台 · 门户布局
 * 通用组件（按钮/卡片/表格/标签/弹窗/Toast/登录页）见 assets/theme.css
 * 本文件只负责骨架布局与门户特有区域
 * ============================================================ */

/* ---------------- 整体骨架 ---------------- */
/* 预留滚动条槽位：iframe 高度自适应会改变页面总高，若滚动条时隐时现会导致整页右移抖动。
   scrollbar-gutter:stable 让滚动条空间始终保留，杜绝因滚动条出现/消失引起的横向位移。 */
html { scrollbar-gutter: stable; }
#app-view { display: flex; min-height: 100vh; }

/* 右侧内容区：顶部一抹极淡的青色氛围光 */
.p-main {
  flex: 1; min-width: 0;
  padding: 24px 30px 44px;
  background:
    radial-gradient(1100px 380px at 8% -10%, rgba(0, 194, 224, .055), transparent 62%),
    radial-gradient(900px 340px at 98% 0%, rgba(79, 124, 255, .045), transparent 60%),
    var(--bg);
}

/* ---------------- 侧边栏 ---------------- */
.p-sidebar {
  width: 234px; flex: none;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  color: #b9cfe2;
  background: linear-gradient(178deg, #08182c 0%, #0c2340 46%, #113055 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .05);
  overflow: hidden;
}
/* 底部一道缓慢呼吸的青色光带，增加层次 */
.p-sidebar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 180px;
  background: linear-gradient(0deg, rgba(0, 194, 224, .10), transparent);
  pointer-events: none;
  animation: breathe 7s ease-in-out infinite;
}

.p-brand {
  position: relative; z-index: 1;
  padding: 24px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.pb-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; color: #fff;
  letter-spacing: 1.5px;
}
.pb-mark {
  position: relative;
  width: 26px; height: 26px; flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px rgba(0, 194, 224, .34);
}
.pb-mark::before {
  content: "";
  position: absolute; inset: 7px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 2px;
  border-right-color: transparent; border-bottom-color: transparent;
  animation: breathe 3.4s ease-in-out infinite;
}
.p-brand small {
  display: block; margin-top: 6px;
  font-size: 11px; font-weight: 400;
  color: #7ea6c8; letter-spacing: 2.4px;
}

.p-nav { position: relative; z-index: 1; flex: 1; padding: 14px 0; overflow-y: auto; }
.p-nav::-webkit-scrollbar { width: 0; }

.p-nav-item {
  position: relative;
  padding: 12px 22px;
  cursor: pointer;
  font-size: 14px;
  color: #b0c8dd;
  letter-spacing: .3px;
  border-left: 3px solid transparent;
  transition: color .2s, background .22s, padding-left .22s;
}
.p-nav-item::before {
  /* 激活态左侧的青色光条 */
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: height .26s cubic-bezier(.22, 1, .36, 1);
}
.p-nav-item:hover {
  color: #eaf4fc;
  background: rgba(255, 255, 255, .055);
  padding-left: 26px;
}
.p-nav-item.on {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(0, 194, 224, .16), rgba(0, 194, 224, .02));
}
.p-nav-item.on::before { height: 22px; }

/* 无权限：淡化并挂一枚小标签，点进去会提示联系管理员 */
.p-nav-item.no-perm { opacity: .5; }
.p-nav-item .lock {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10.5px;
  letter-spacing: .5px;
  color: #b9cfe2;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
}
.p-nav-sep { height: 1px; background: rgba(255, 255, 255, .10); margin: 12px 20px; }

.p-foot {
  position: relative; z-index: 1;
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 12px;
}
.p-who { color: #8fb3d1; margin-bottom: 9px; word-break: break-all; }
/* 侧边栏底部的当前版本标记 */
.p-plan {
  display: inline-block;
  margin-bottom: 10px; padding: 3px 9px;
  font-size: 11.5px; color: #bfe6f2;
  background: rgba(0, 194, 224, .14);
  border: 1px solid rgba(0, 194, 224, .32);
  border-radius: 20px;
}
.p-plan.warn { color: #ffd9a8; background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .38); }
.p-plan.bad { color: #ffc3c3; background: rgba(229, 57, 53, .18); border-color: rgba(229, 57, 53, .42); }
.p-foot button {
  width: 100%; padding: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: transparent; color: #cfe3f2;
  border-radius: var(--r-sm); cursor: pointer;
  font-size: 13px; font-family: inherit;
  transition: all .2s;
}
.p-foot button:hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(0, 194, 224, .45);
  color: #fff;
}

/* ---------------- 顶栏 ---------------- */
.p-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.p-topbar h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 5px;
  font-size: 22px; font-weight: 700; color: var(--brand);
  letter-spacing: .3px;
}
.p-topbar h2::before {
  content: "";
  width: 4px; height: 19px; flex: none;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.p-topbar .desc { font-size: 13px; color: var(--muted); padding-left: 14px; }
.p-topbar-act { display: flex; gap: 9px; flex: none; }

/* ---------------- 子导航 ---------------- */
.p-subnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.p-subnav .psn-tabs { display: flex; gap: 9px; flex-wrap: wrap; }
.p-subnav .psn-right {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: var(--muted);
}
.p-subnav .psn-right label { font-size: 12px; font-weight: 600; color: var(--muted); }
.p-subnav .psn-right select {
  width: auto; padding: 6px 28px 6px 11px;
  font-size: 12px; border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2);
  appearance: none; cursor: pointer;
  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 10px center;
}
.p-subnav .psn-right select:focus {
  border-color: rgba(0, 194, 224, .55);
  box-shadow: 0 0 0 3px rgba(0, 194, 224, .12);
  outline: none;
}
.p-subnav .psn-tip { font-size: 12px; color: var(--muted); }

/* ---------------- 内嵌 iframe ---------------- */
#mod-recruit { display: flex; flex-direction: column; height: calc(100vh - 68px); }
#mod-recruit.hidden { display: none !important; }
#mod-recruit .p-topbar { margin-bottom: 12px; }
.p-frame {
  width: 100%; flex: 1 1 auto; min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-2);
}
/* AI 视频面试 / 盘点 / 设置内容较高，按内部文档实际高度撑开 */
#aivideo-frame, #talent-frame, #settings-frame {
  flex: 0 0 auto; min-height: calc(100vh - 240px);
}

/* ---------------- 工作台 ---------------- */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
}
.mod-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), box-shadow .24s, border-color .24s;
}
/* 顶部渐变细线，hover 时铺满 */
.mod-card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 0 2px 2px 0;
  transition: width .3s cubic-bezier(.22, 1, .36, 1);
}
.mod-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-3);
  border-color: rgba(0, 194, 224, .38);
}
.mod-card:hover::before { width: 100%; }
/* 工作台固定两排各四个：宽度够就 4 列，窄屏逐级回落 */
.mod-grid.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1180px) { .mod-grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .mod-grid.grid-4 { grid-template-columns: 1fr; } }

/* 卡片头：小图标 + 模块名 + 未授权标记 */
.mc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.mc-ico {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 10px rgba(0, 154, 200, .22);
}
.mc-name {
  font-weight: 700; font-size: 15.5px;
  color: var(--brand); letter-spacing: .3px;
  flex: 1; min-width: 0;
}
.mc-lock {
  flex: none; font-size: 11px; padding: 2px 7px; border-radius: 999px;
  color: var(--warn); border: 1px solid rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .08);
}
.mod-card.no-perm { opacity: .72; }
.mod-card.no-perm .mc-ico { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: none; }
.mod-card.no-perm:hover { transform: none; box-shadow: var(--sh-1); }

/* 子功能标签：让卡片更饱满，一眼看出模块里有什么 */
.mc-subs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 26px; }
.mc-chip {
  font-size: 11.5px; line-height: 1; padding: 5px 8px; border-radius: 6px;
  color: var(--text-2); background: rgba(0, 154, 200, .07);
  border: 1px solid rgba(0, 154, 200, .16);
}

.home-card h3 .h3-sub {
  margin-left: 10px; font-size: 12px; font-weight: 500;
  color: var(--muted); letter-spacing: .5px;
}
.mc-desc {
  font-size: 12.5px; color: var(--muted);
  line-height: 1.75; min-height: 44px;
}
.mc-go {
  margin-top: 12px;
  font-size: 13px; font-weight: 600; color: var(--brand-2);
  display: flex; align-items: center; gap: 6px;
}
.mc-go .arrow {
  font-style: normal;
  transition: transform .26s cubic-bezier(.22, 1, .36, 1);
}
.mod-card:hover .mc-go .arrow { transform: translateX(5px); }

.link-note {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}
.ln-item { display: flex; border-bottom: 1px solid var(--line); }
.ln-item:last-child { border-bottom: none; }
.ln-k {
  width: 168px; flex: none;
  padding: 13px 16px;
  background: linear-gradient(180deg, #fafcfe, #f5f9fc);
  font-weight: 600; font-size: 13px; color: var(--brand);
}
.ln-v {
  padding: 13px 16px;
  font-size: 13px; line-height: 1.8; color: var(--text-2);
}

/* ---------------- 建设中板块 ---------------- */
.soon-card { text-align: center; padding: 52px 24px; }
.soon-tag {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  color: #0a7f9a;
  background: var(--accent-soft);
  border: 1px solid rgba(0, 194, 224, .28);
  margin-bottom: 16px;
}
.soon-title {
  font-size: 21px; font-weight: 700; color: var(--brand);
  margin-bottom: 8px; letter-spacing: .5px;
}
.soon-desc { font-size: 13px; color: var(--muted); }
.soon-plan {
  display: inline-block; text-align: left;
  margin: 20px auto 0; padding-left: 22px;
  font-size: 13px; color: var(--text-2); line-height: 2.1;
}
.soon-plan li::marker { color: var(--accent); }
.soon-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ---------------- 智慧测评筛选条 ---------------- */
.as-filterbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.as-filterbar input {
  flex: 1; min-width: 180px;
}
.as-filterbar select { width: auto; }

/* ---------------- 测评标签 ---------------- */
.atag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  margin: 0 4px 4px 0;
  white-space: nowrap;
  transition: filter .2s, transform .2s;
}
.atag.no-phone { font-weight: 400; }
.atag.off {
  background: #f1f5f9; color: #a8b7c6;
  border: 1px solid var(--line);
}
.atag.on {
  border: none; color: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 37, 64, .16);
}
.atag.on:hover { filter: brightness(1.10); transform: translateY(-1px); }
.atag.a-IQ   { background: linear-gradient(120deg, #2a6ba8, #1c4f80); }
.atag.a-OPQ  { background: linear-gradient(120deg, #7b5bd6, #5b3fb0); }
.atag.a-MQ   { background: linear-gradient(120deg, #16b877, #0e8f5a); }
.atag.a-DISC { background: linear-gradient(120deg, #f0a832, #d1840f); }
.tagcell { white-space: nowrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  #app-view { flex-direction: column; }
  .p-sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    overflow-x: auto;
  }
  .p-sidebar::after { display: none; }
  .p-brand { border: none; padding: 13px 16px; }
  .p-brand small { display: none; }
  .p-nav { display: flex; padding: 0 8px; }
  .p-nav-item {
    padding: 11px 14px; white-space: nowrap;
    border-left: none; border-bottom: 3px solid transparent;
    font-size: 13.5px;
  }
  .p-nav-item::before { display: none; }
  .p-nav-item.on { border-bottom-color: var(--accent); background: rgba(255, 255, 255, .08); }
  .p-nav-item:hover { padding-left: 14px; }
  .p-nav-sep { display: none; }
  .p-foot { display: none; }
  .p-main { padding: 18px 16px 32px; }
  .p-topbar { flex-direction: column; }
  .mod-grid { grid-template-columns: 1fr; }
  .ln-item { flex-direction: column; }
  .ln-k { width: 100%; padding-bottom: 6px; }
  .ln-v { padding-top: 0; }
  .rd-meta { grid-template-columns: 1fr; }
}

/* ---------------- 兑换码 ---------------- */
.rd-alert {
  border-left: 3px solid var(--warn);
  background: linear-gradient(90deg, rgba(245, 158, 11, .12), rgba(245, 158, 11, .02));
  color: #8a5a10;
  font-size: 13.5px;
}
.rd-cur { padding: 4px 0 2px; }
.rd-plan {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 20px; font-weight: 700; color: var(--text);
}
.rd-tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; background: #eef4fa; color: var(--muted);
  border: 1px solid var(--line);
}
.rd-tag.ok { color: #0f7b52; background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .32); }
.rd-tag.warn { color: #96620a; background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .34); }
.rd-tag.bad { color: #b3261e; background: rgba(229, 57, 53, .12); border-color: rgba(229, 57, 53, .32); }
.rd-tag.cur { color: var(--brand-2); background: rgba(28, 79, 128, .10); border-color: rgba(28, 79, 128, .28); }
.rd-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin: 14px 0 0;
}
.rd-meta > div {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: linear-gradient(180deg, #fbfdff, #f6f9fd);
}
.rd-meta span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.rd-meta strong { font-size: 14px; color: var(--text); }
.rd-next {
  margin-top: 12px; padding: 9px 12px; font-size: 12.5px; color: #0b4f63;
  background: linear-gradient(90deg, rgba(0, 194, 224, .12), rgba(0, 194, 224, .02));
  border-left: 3px solid var(--accent); border-radius: 8px;
}
.rd-mods { margin-top: 14px; }
.rd-lb { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.rd-list { display: flex; flex-wrap: wrap; gap: 7px; }
.rd-chip {
  padding: 4px 11px; font-size: 12.5px; border-radius: 20px;
  color: var(--brand-2); background: rgba(28, 79, 128, .08);
  border: 1px solid rgba(28, 79, 128, .18);
}
.rd-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rd-form input {
  flex: 1; min-width: 200px; max-width: 320px;
  padding: 11px 14px; font-size: 15px; letter-spacing: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.rd-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 194, 224, .16);
}
.rd-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.p-tbl tr.cur td { background: rgba(0, 194, 224, .07); }
/* 版本对照表：版本列要给「版本名 + 当前标签」留够宽度，否则标签会被挤到下一行 */
.rd-cmp th, .rd-cmp td { vertical-align: middle; }
.rd-cmp td:first-child, .rd-cmp th:first-child { white-space: nowrap; }
.rd-cmp td:first-child .rd-tag { margin-left: 8px; }
.rd-cmp td:last-child { white-space: nowrap; color: var(--muted); }
