/* base.css —— reset / CSS 变量（字号档位·间距档位）/ 布局骨架 / 通用组件 */
:root {
  --c-bg: #f5f6f8;
  --c-panel: #ffffff;
  --c-border: #e2e5ea;
  --c-text: #1f2430;
  --c-text-2: #626b7a;
  --c-text-3: #98a1b0;
  --c-primary: #2f6bff;
  --c-primary-d: #1f52d0;
  --c-danger: #e5484d;
  --c-warn: #f5a524;
  --c-ok: #2fa36b;

  /* 字号/行距档位（简历用；body 类名切换）*/
  --fs-body: 10.5pt;
  --lh: 1.45;
  --page-pad: 14mm;
  --sec-gap: 6mm;
  --bullet-gap: 1mm;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(20, 30, 60, 0.08), 0 6px 20px rgba(20, 30, 60, 0.06);
  --nav-w: 168px;
  font-synthesis: none;
}

/* 简历字号档位（可作用于 body 或任意包裹元素） */
.size-comfort { --fs-body: 11pt; --lh: 1.55; }
.size-standard { --fs-body: 10.5pt; --lh: 1.45; }
.size-compact { --fs-body: 10pt; --lh: 1.35; }
.size-tight { --fs-body: 9.5pt; --lh: 1.30; }
/* 页边距档位 */
.margin-wide { --page-pad: 18mm; }
.margin-normal { --page-pad: 14mm; }
.margin-tight { --page-pad: 10mm; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- 应用外壳 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.nav {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  background: #141a26;
  color: #cfd6e4;
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  position: sticky; top: 0; height: 100vh;
}
.nav .brand { font-size: 15px; font-weight: 700; color: #fff; padding: 0 18px 16px; letter-spacing: .5px; }
.nav .nav-items { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav a.nav-link {
  display: block; color: #cfd6e4; padding: 10px 18px; font-size: 14px; border-left: 3px solid transparent;
}
.nav a.nav-link:hover { background: #1d2534; color: #fff; }
.nav a.nav-link.active { background: #1d2534; color: #fff; border-left-color: var(--c-primary); font-weight: 600; }
.nav .nav-foot { padding: 8px 18px 0; border-top: 1px solid #232c3d; margin-top: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--c-panel); border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 17px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view-wrap { padding: 18px 20px 40px; }
.view { max-width: 1400px; }

/* ---------- 组件：按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text);
  padding: 7px 12px; border-radius: var(--radius); cursor: pointer; font-size: 13px; line-height: 1.2;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f2f4f8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-d); border-color: var(--c-primary-d); }
.btn-danger { background: #fff; border-color: #f2c4c6; color: var(--c-danger); }
.btn-danger:hover { background: #fdf2f2; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-text-2); }
.btn-sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }

/* ---------- 组件：卡片 / 面板 ---------- */
.card { background: var(--c-panel); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--c-border); font-weight: 600; }
.card-body { padding: 16px; }
.muted { color: var(--c-text-2); }
.small { font-size: 12px; }
.empty { color: var(--c-text-3); padding: 28px; text-align: center; }

/* ---------- 表单 ---------- */
label.fld { display: block; margin-bottom: 10px; font-size: 12px; color: var(--c-text-2); }
label.fld > span { display: block; margin-bottom: 4px; }
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], textarea, select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--c-border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--c-text);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(47,107,255,.14); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: #eef1f6; font-size: 12px; color: var(--c-text-2); }
.pill.on { background: #e7efff; color: var(--c-primary-d); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: #eef1f6; font-size: 12px; }
.tag .x { cursor: pointer; color: var(--c-text-3); }
.tag .x:hover { color: var(--c-danger); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; background: #eef1f6; color: var(--c-text-2); }
.badge.new { background: #e7efff; color: var(--c-primary-d); }
.badge.interested { background: #e6f7ee; color: var(--c-ok); }
.badge.ignored { background: #f0f0f0; color: var(--c-text-3); }
mark { background: #fff3bf; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- 抽屉 / 弹窗 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,20,35,.42); display: flex; justify-content: flex-end; z-index: 100; }
.drawer-mask.center { justify-content: center; align-items: center; }
.drawer { background: var(--c-panel); width: min(760px, 96vw); height: 100%; overflow: auto; box-shadow: -8px 0 30px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; background: #fff; z-index: 2; }
.drawer-body { padding: 16px 18px 40px; }
.modal { background: #fff; border-radius: 12px; width: min(520px, 94vw); max-height: 88vh; overflow: auto; box-shadow: var(--shadow); }
.modal .drawer-head { border-radius: 12px 12px 0 0; }

/* ---------- toast ---------- */
#toast-host { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #1f2534; color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); max-width: 380px; }
.toast.err { background: var(--c-danger); }
.toast.ok { background: var(--c-ok); }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
table.tbl th { color: var(--c-text-2); font-weight: 600; background: #fafbfc; }

/* ---------- 溢出/提示横幅 ---------- */
.banner { padding: 9px 14px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner.warn { background: #fff8e6; color: #8a5a00; border: 1px solid #f5d78e; }
.banner.danger { background: #fdecec; color: #9c2b2f; border: 1px solid #f5b6b8; }
.banner.ok { background: #e9f8f0; color: #1c6b44; border: 1px solid #b7e6cc; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .nav { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; }
  .nav .brand { padding: 0 12px 0 4px; white-space: nowrap; }
  .nav .nav-items { flex-direction: row; }
  .nav a.nav-link { border-left: none; border-bottom: 3px solid transparent; padding: 8px 10px; white-space: nowrap; }
  .nav a.nav-link.active { border-left: none; border-bottom-color: var(--c-primary); }
  .nav .nav-foot { border: none; margin: 0; padding: 0 4px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .view-wrap { padding: 12px; }
}
