/* ============ 考勤产品规划工作台 · Phase 2 原型 ============ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --purple: #7c3aed;
  --cyan: #0891b2;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo { padding: 20px 18px 4px; font-size: 16px; font-weight: 700; color: #fff; }
.logo-sub { padding: 0 18px 18px; font-size: 11px; color: #64748b; border-bottom: 1px solid #1e293b; }
#nav .nav-group { display: flex; align-items: center; gap: 6px; padding: 14px 18px 4px; font-size: 11px; color: #64748b; letter-spacing: 1px; }
#nav .nav-group::after { content: ''; flex: 1; height: 1px; background: #1e293b; }
#nav .nav-group b { color: #94a3b8; font-weight: 600; }
#nav { padding: 12px 10px; flex: 1; }
#nav a {
  display: block; padding: 10px 12px; border-radius: 8px; color: #94a3b8;
  margin-bottom: 4px; font-size: 14px;
}
#nav a:hover { background: #1e293b; color: #e2e8f0; }
#nav a.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 14px; border-top: 1px solid #1e293b; }
.ver { font-size: 11px; color: #475569; text-align: center; margin-top: 8px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
#topbar-title { font-size: 16px; font-weight: 600; }
.gate-badge {
  font-size: 12px; background: #fff7ed; color: var(--orange);
  border: 1px solid #fed7aa; border-radius: 20px; padding: 4px 12px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.badge-offline { background: #fee2e2; color: var(--red); border-color: #fca5a5; }
#main { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---------- 卡片与网格 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card h3 { font-size: 15px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; cursor: pointer; transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(15,23,42,.08); }
.stat-num { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-hint { font-size: 11px; color: var(--primary); margin-top: 6px; }

/* ---------- 徽章 ---------- */
.bge {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 12px;
  white-space: nowrap; font-weight: 500;
}
.st-new { background: #f1f5f9; color: #475569; }
.st-analyzing { background: #dbeafe; color: var(--primary); }
.st-approved { background: #dcfce7; color: var(--green); }
.st-rejected { background: #fee2e2; color: var(--red); }
.st-deferred { background: #fef3c7; color: var(--orange); }
.st-designing { background: #ede9fe; color: var(--purple); }
.st-review { background: #cffafe; color: var(--cyan); }
.st-scheduled { background: #bbf7d0; color: #15803d; }
.mat-缺失 { background: #fee2e2; color: var(--red); }
.mat-基础 { background: #fef3c7; color: var(--orange); }
.mat-完善 { background: #dbeafe; color: var(--primary); }
.mat-领先 { background: #dcfce7; color: var(--green); }
.mat-未评估 { background: #f1f5f9; color: #94a3b8; border: 1px dashed #cbd5e1; }
.cp-ref { background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 8px; padding: 10px 14px; font-size: 12px; line-height: 2; margin-bottom: 12px; }
.cp-ref .t { font-weight: 600; color: #6b21a8; }
.insight-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 14px; background: #fff; }
.sit-cell { display: inline-block; min-width: 56px; border-radius: 6px; padding: 5px 10px; font-weight: 600; font-size: 13px; cursor: pointer; }
.sit-cell:hover { filter: brightness(0.95); }
.sit-focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.sit-cnt { font-size: 11px; opacity: .7; margin-left: 3px; font-weight: 400; }
.sit-ahead { background: #dcfce7; color: #15803d; }
.sit-behind { background: #fef3c7; color: #b45309; }
.sit-alarm { background: #fee2e2; color: #b91c1c; }
.sit-mixed { background: #e0f2fe; color: #0369a1; }
.sit-empty { background: #f8fafc; color: #cbd5e1; cursor: default; }
.meth-layer { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; background: #fff; }
.meth-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.meth-no { background: var(--primary); color: #fff; border-radius: 6px; padding: 1px 10px; font-size: 13px; font-weight: 600; }
.meth-items { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { background: #f1f5f9; border: 1px solid var(--border); color: #475569; border-radius: 6px; padding: 1px 8px; font-size: 12px; margin-right: 4px; display: inline-block; margin-bottom: 2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 8px 16px;
  font-size: 13px; cursor: pointer; background: var(--primary); color: #fff;
  transition: background .15s; font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: #64748b; border: 1px solid var(--border); }
.btn-ghost:hover { background: #f8fafc; color: var(--text); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #15803d; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 500;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: #f8fafc;
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: #f8fafc; cursor: pointer; }

/* ---------- 筛选 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: 5px 14px; border-radius: 16px; font-size: 13px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); color: #475569;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip .cnt { opacity: .75; margin-left: 2px; font-size: 12px; }

/* ---------- 表单 ---------- */
.inp, textarea.inp, select.inp {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
.inp:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
textarea.inp { resize: vertical; min-height: 72px; line-height: 1.6; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-row label .req { color: var(--red); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checkline { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; font-size: 13px; }
.checkline input[type=checkbox] { margin-top: 2px; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a {
  padding: 10px 18px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .lock { font-size: 12px; }

/* ---------- 需求详情 ---------- */
.req-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.req-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req-id { font-size: 13px; color: var(--muted); font-weight: 400; }
.backlink { font-size: 13px; margin-bottom: 10px; display: inline-block; }
.dl { display: grid; grid-template-columns: 110px 1fr; row-gap: 10px; column-gap: 16px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { white-space: pre-wrap; }
.lockbox {
  border: 1.5px dashed #fca5a5; background: #fef2f2; border-radius: 10px;
  padding: 24px; text-align: center; color: #7f1d1d;
}
.lockbox .big { font-size: 32px; margin-bottom: 8px; }
.lockbox p { margin: 8px 0 16px; color: #991b1b; }

/* ---------- 合理性分析 ---------- */
.dim-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.dim-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dim-name { font-weight: 600; font-size: 14px; }
.dim-weight { font-size: 12px; color: var(--muted); }
.q-list { margin: 0 0 12px 18px; }
.q-list li { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.seg { display: flex; gap: 6px; }
.seg button {
  width: 40px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 13px; color: #475569;
}
.seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.seg button.on[data-v="1"], .seg button.on[data-v="2"] { background: var(--red); border-color: var(--red); }
.seg button.on[data-v="3"] { background: var(--orange); border-color: var(--orange); }
.seg button.on[data-v="4"], .seg button.on[data-v="5"] { background: var(--green); border-color: var(--green); }
.dimline { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dimline .dn { width: 110px; font-size: 13px; flex-shrink: 0; }
.bar-bg { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.bar { height: 100%; border-radius: 4px; background: var(--primary); }
.dimline .ds { width: 46px; text-align: right; font-weight: 600; font-size: 13px; }
.dimnote { font-size: 12px; color: #475569; background: #f8fafc; border-radius: 6px; padding: 8px 12px; line-height: 1.7; }
.concl-banner { border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; font-size: 14px; }
.cb-approved { background: #dcfce7; border: 1px solid #86efac; color: #14532d; }
.cb-conditional { background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; }
.cb-rejected { background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d; }
.cb-deferred { background: #e0e7ff; border: 1px solid #a5b4fc; color: #312e81; }
.rice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rice-result { margin-top: 12px; font-size: 13px; }

/* ---------- 漏斗 ---------- */
.frow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.frow .fl { width: 110px; font-size: 13px; color: #475569; text-align: right; flex-shrink: 0; }
.fbar-bg { flex: 1; height: 22px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.fbar { height: 100%; border-radius: 6px; color: #fff; font-size: 12px; display: flex; align-items: center; padding-left: 10px; min-width: 28px; }
.frow .fc { width: 36px; font-weight: 600; }

/* ---------- 知识库 ---------- */
.maturity-sel { border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.metric-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.metric-name { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.metric-val { font-size: 22px; font-weight: 700; }
.metric-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
.timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ''; position: absolute; left: -26px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary);
}
.timeline-item .tv { font-weight: 600; font-size: 13px; }
.timeline-item .td { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.timeline-item .tx { font-size: 13px; line-height: 1.6; }

/* ---------- 模态框 & Toast ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 640px; max-width: 100%;
  max-height: 80vh; overflow: auto; padding: 24px;
}
.modal h3 { margin-bottom: 18px; font-size: 16px; }
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; border-radius: 8px; padding: 10px 22px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.blink { animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- 杂项 ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.autosave { font-size: 11px; color: var(--green); }
.sec-title { font-weight: 600; font-size: 14px; margin: 18px 0 8px; }
.sec-title .req { color: var(--red); }
.auto-box { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 12px 16px; font-size: 13px; line-height: 1.8; }
.auto-box .src { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.remind-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.remind-item:last-child { border-bottom: none; }
.gate-rules li { margin: 6px 0 6px 18px; font-size: 13px; color: #475569; line-height: 1.7; }

/* ---------- 🔐 账号体系（登录页 / 用户区 / 账号管理） ---------- */
.auth-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  width: 360px; background: #fff; border-radius: 14px; padding: 34px 34px 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.auth-logo { font-size: 40px; text-align: center; }
.auth-title { font-size: 19px; font-weight: 700; text-align: center; margin-top: 6px; }
.auth-sub { font-size: 12px; color: #64748b; text-align: center; margin: 6px 0 18px; }
.auth-tip {
  background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
  font-size: 12px; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px;
}
.auth-foot { font-size: 11px; color: #94a3b8; text-align: center; margin-top: 14px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg, #f1f5f9); border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px; padding: 3px 10px; font-size: 12px;
}
.user-chip b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .role-admin { color: #b45309; font-size: 11px; }
.auth-card .form-row { margin: 10px 0; }
.auth-card .form-row label { display: block; font-size: 12px; color: #475569; margin-bottom: 4px; }
.auth-card .inp { width: 100%; box-sizing: border-box; }
