:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7686;
  --line: #e6eaf0;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --sidebar: #f7f8fc;
  --sidebar-strong: #111827;
  --green: #16a34a;
  --blue: #2563eb;
  --orange: #ea580c;
  --red: #dc2626;
  --shadow: 0 8px 30px rgba(31, 39, 51, 0.08);
  --sidebar-width: 280px;
  --sidebar-collapsed: 88px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.app-shell { min-height: 100vh; background: var(--bg); }
.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left .22s ease;
}
.app-shell.sidebar-collapsed .main-shell { margin-left: var(--sidebar-collapsed); }
.app-shell.mobile-shell .main-shell { margin-left: 0; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #fbfbfe 0%, #f5f7fc 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: width .22s ease, transform .22s ease;
}
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.app-shell.mobile-shell .sidebar {
  transform: translateX(-100%);
  box-shadow: 0 12px 42px rgba(15, 23, 42, 0.18);
}
.app-shell.mobile-shell.sidebar-open .sidebar { transform: translateX(0); }

.sidebar-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 20;
  backdrop-filter: blur(2px);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sidebar-brand-copy h1 {
  margin: 0;
  font-size: 15px;
  color: var(--sidebar-strong);
}
.sidebar-brand-copy p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-toggle,
.menu-trigger {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.sidebar-toggle:hover,
.menu-trigger:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.sidebar-scroll {
  padding: 14px 12px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sidebar-section {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(230, 234, 240, 0.9);
  border-radius: 16px;
  padding: 12px;
}
.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: .02em;
}
.sidebar-mode-card {
  background: linear-gradient(135deg, #eef2ff 0%, #f6f7ff 100%);
  border: 1px solid #dfe3ff;
  border-radius: 14px;
  padding: 12px;
}
.sidebar-mode-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}
.sidebar-mode-desc {
  font-size: 12px;
  color: #4b5563;
  margin-top: 4px;
}

.sidebar-nav-item {
  width: 100%;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  text-align: left;
  margin-bottom: 8px;
}
.sidebar-nav-item:last-child { margin-bottom: 0; }
.sidebar-nav-item:hover {
  border-color: #d9ddff;
  background: #f8f9ff;
}
.sidebar-nav-item.active {
  border-color: #cfd6ff;
  background: #eef2ff;
}
.sidebar-nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f3f4f8;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  flex: none;
}
.sidebar-nav-item.active .sidebar-nav-icon {
  background: var(--brand-soft);
}
.sidebar-nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sidebar-nav-item.disabled:hover {
  border-color: transparent;
  background: #fff;
}
.sidebar-nav-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-nav-copy strong {
  font-size: 13px;
  color: var(--ink);
}
.sidebar-nav-copy small {
  color: var(--muted);
  font-size: 11.5px;
}

.sidebar-mini-list { display: grid; gap: 6px; }
.sidebar-mini-btn {
  width: 100%; border: none; text-align: left; cursor: pointer;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: .15s;
  font-family: inherit;
}
.sidebar-mini-btn:hover {
  border-color: #d9ddff;
  background: #f8f9ff;
}
.sidebar-mini-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.sidebar-mini-btn span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.sidebar-mini-btn.active span {
  color: var(--brand);
}
.sidebar-mini-btn small {
  font-size: 11.5px;
  color: var(--muted);
}

.sidebar-section-actions { margin-top: auto; }
.sidebar-action {
  width: 100%;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.sidebar-action.primary-action {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.app-shell.sidebar-collapsed .sidebar-brand-copy,
.app-shell.sidebar-collapsed .sidebar-title,
.app-shell.sidebar-collapsed .sidebar-mode-desc,
.app-shell.sidebar-collapsed .sidebar-nav-copy,
.app-shell.sidebar-collapsed .sidebar-mini-item small,
.app-shell.sidebar-collapsed .sidebar-action {
  display: none;
}
.app-shell.sidebar-collapsed .sidebar-scroll { padding: 14px 10px 20px; }
.app-shell.sidebar-collapsed .sidebar-section {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-shell.sidebar-collapsed .sidebar-mode-card,
.app-shell.sidebar-collapsed .sidebar-nav-item,
.app-shell.sidebar-collapsed .sidebar-mini-item {
  padding: 8px;
  justify-content: center;
}
.app-shell.sidebar-collapsed .sidebar-mode-label {
  text-align: center;
  font-size: 11px;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px; background: #fff; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; gap: 12px;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-title-row h2 {
  font-size: 18px;
  margin: 0;
}
.brand-pill {
  font-size: 11.5px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #dfe3ff;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}
.sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.audience { font-size: 12.5px; color: var(--muted); text-align: right; }

/* ── 顶部栏右侧（语言切换 + audience） ─────────────── */
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lang-btn {
  background: var(--brand-soft); border: 1.5px solid var(--brand); border-radius: 8px;
  color: var(--brand); font-size: 12px; font-weight: 700; padding: 5px 14px; cursor: pointer;
  transition: .15s; min-width: 48px; text-align: center;
}
.lang-btn:hover { background: var(--brand); color: #fff; }
.brand-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand); padding: 2px 10px;
  border-radius: 999px; border: 1px solid transparent; margin-left: 8px;
  vertical-align: middle;
}

.stepper {
  display: flex; gap: 10px; padding: 18px 32px; max-width: 1000px; margin: 0 auto;
  flex-wrap: wrap;
}
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.step .dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600;
}
.step.active { color: var(--brand); font-weight: 600; }
.step.active .dot { background: var(--brand); color: #fff; border-color: var(--brand); }
.step.done .dot { background: var(--green); color: #fff; border-color: var(--green); }

.container { max-width: 1120px; margin: 0 auto; padding: 8px 32px 40px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card h2 { margin: 0 0 6px; font-size: 18px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 8px; }

.role-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px;
  font-size: 13.5px; cursor: pointer; background: #fff; transition: .15s;
}
.pill input { display: none; }
.pill.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-family: inherit; resize: vertical; outline: none; transition: .15s;
}
textarea:focus { border-color: var(--brand); }

.upload {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 20px;
  display: flex; align-items: center; gap: 14px; background: #fafbff;
}
.upload.drag { border-color: var(--brand); background: var(--brand-soft); }
.fname { font-size: 13px; color: var(--muted); }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
button { cursor: pointer; border: none; border-radius: 10px; font-size: 14px; padding: 11px 22px; transition: .15s; }
.primary { background: var(--brand); color: #fff; font-weight: 600; }
.primary:hover { filter: brightness(1.05); }
.primary:disabled { background: #c7c9f0; cursor: not-allowed; }
.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.ghost:hover { border-color: var(--brand); color: var(--brand); }
.err { color: var(--red); font-size: 13px; }

/* 匹配度 */
.match-wrap { display: flex; gap: 36px; align-items: center; flex-wrap: wrap; }
.ring-box { text-align: center; }
.ring { width: 200px; height: 200px; }
.ring-bg { fill: none; stroke: #eef0f5; stroke-width: 16; }
.ring-fg { fill: none; stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .9s ease; }
.ring-score { text-anchor: middle; font-size: 46px; font-weight: 700; fill: var(--ink); }
.ring-unit { text-anchor: middle; font-size: 14px; fill: var(--muted); }
.ring-note { font-weight: 600; margin-top: 4px; }

.dims { flex: 1; min-width: 280px; }
.dim { margin-bottom: 14px; }
.dim-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.bar { height: 10px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; transition: width .9s ease; }
.matched { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* 差距 */
.gaps { display: grid; gap: 12px; }
.gap { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fcfdff; }
.imp { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.i5 { background: var(--red); } .i4 { background: var(--orange); } .i3 { background: #d97706; } .i2 { background: var(--blue); } .i1 { background: #94a3b8; }
.gap-body { font-size: 13.5px; }
.gap-top { display: flex; align-items: center; gap: 10px; }
.dim-tag { font-size: 11.5px; color: var(--muted); background: #f1f3f8; padding: 2px 8px; border-radius: 999px; }
.gap-body p { margin: 6px 0; color: #3a4453; }
.gap-body a, .pstep a { color: var(--brand); font-size: 12.5px; text-decoration: none; }
.gap-body a:hover, .pstep a:hover { text-decoration: underline; }

/* 学习路线 */
.block-title { margin: 26px 0 12px; font-size: 16px; }
.phase { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.phase-name { background: var(--brand-soft); color: var(--brand); font-weight: 700; padding: 10px 16px; font-size: 14px; }
.phase-steps { padding: 12px 16px; display: grid; gap: 12px; }
.pstep { border-left: 3px solid var(--brand); padding-left: 12px; }
.pstep-top { display: flex; justify-content: space-between; align-items: center; }
.est { font-size: 12px; color: var(--muted); background: #f1f3f8; padding: 2px 8px; border-radius: 999px; }
.pstep p { margin: 6px 0; font-size: 13px; color: #3a4453; }

/* 面试 */
.interview { background: #fcfdff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.iv-sub { font-weight: 600; font-size: 13.5px; margin: 6px 0; }
.interview ul { margin: 6px 0 14px; padding-left: 20px; }
.interview li { font-size: 13.5px; margin-bottom: 8px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

@media (max-width: 960px) {
  .topbar, .stepper, .container { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 640px) {
  .topbar, .stepper, .container { padding-left: 16px; padding-right: 16px; }
  .audience { text-align: left; }
  .brand-title-row { flex-wrap: wrap; }
  .menu-trigger { display: inline-grid; }
}

/* ── Gate 模式选择器 ─────────────────────────────────── */
.mode-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-pill {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px;
  cursor: pointer; background: #fff; transition: .15s; flex: 1; min-width: 160px;
  display: flex; flex-direction: column; gap: 4px;
}
.mode-pill input { display: none; }
.mode-pill.on { border-color: var(--brand); background: var(--brand-soft); }
.mode-pill .mode-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.mode-pill.on .mode-label { color: var(--brand); }
.mode-pill .mode-desc { font-size: 12px; color: var(--muted); }
.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ── 多 JD 输入 ──────────────────────────────────────── */
.multi-jd { display: flex; flex-direction: column; gap: 12px; }
.jd-field { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafbff; }
.jd-field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.jd-num { font-weight: 700; font-size: 13px; color: var(--brand); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-add { background: #fff; border: 1.5px dashed var(--line); border-radius: 10px; padding: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.btn-add:hover { border-color: var(--brand); color: var(--brand); }

/* ── JD 拆解分析 ─────────────────────────────────────── */
.jd-analysis { display: flex; flex-direction: column; gap: 18px; }
.jd-section { }
.jd-section h3 { font-size: 14.5px; margin: 0 0 8px; color: var(--ink); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px;
  font-weight: 500; border: 1.5px solid transparent;
}
.tag-required { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.tag-preferred { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.tag-tech { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.tag-domain { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.tag-found { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.empty-hint { font-size: 12.5px; color: var(--muted); }
.simple-list { margin: 4px 0; padding-left: 18px; }
.simple-list li { font-size: 13px; margin-bottom: 4px; color: #3a4453; }

/* ── 简历基线诊断 ────────────────────────────────────── */
.diag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .diag-grid { grid-template-columns: 1fr; } }
.diag-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fcfdff;
}
.diag-head { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }

/* ── 多 JD 对比 ──────────────────────────────────────── */
.compare-table-wrap { overflow-x: auto; margin: 14px 0; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th, .compare-table td {
  border: 1px solid var(--line); padding: 10px 14px; text-align: left;
}
.compare-table th { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.compare-table td { background: #fff; }
.diff-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.diff-imp { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.imp-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #f1f3f8; color: var(--muted); }
.diff-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

/* ── 五维评审 ────────────────────────────────────────── */
.five-dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .five-dim-grid { grid-template-columns: 1fr; } }
.fd-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: #fcfdff; display: flex; flex-direction: column; gap: 6px;
}
.fd-head { display: flex; justify-content: space-between; align-items: center; }
.fd-label { font-weight: 600; font-size: 13px; }
.fd-score { font-size: 22px; font-weight: 800; line-height: 1; }
.fd-evidence { font-size: 12.5px; color: #3a4453; margin: 0; }
.fd-deduction { font-size: 12px; color: var(--red); margin: 0; }
.fd-improve { font-size: 12px; color: var(--brand); margin: 0; font-weight: 500; }

/* ── 事实台账 ────────────────────────────────────────── */
.ledger-scroll { overflow-x: auto; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ledger-table th, .ledger-table td {
  border: 1px solid var(--line); padding: 8px 12px; text-align: left;
}
.ledger-table th { background: var(--brand-soft); color: var(--brand); font-weight: 600; white-space: nowrap; }
.ledger-table td { }
.ledger-table .row-infer { opacity: 0.6; }
.evidence-cell { font-size: 12px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-sm { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; padding: 1px 7px; border-radius: 6px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge-green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-orange { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-gray { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
