:root {
  color-scheme: light;
  --bg:#f6f7f9;
  --surface:#ffffff;
  --surface-sub:#f4f5f7;
  --border:#e6e8ec;
  --border-strong:#d3d7de;
  --ink:#111827;
  --ink-2:#374151;
  --muted:#6b7280;
  --faint:#9ca3af;
  --brand:#4f46e5;
  --brand-hover:#4338ca;
  --brand-soft:#eef0fe;
  --brand-ring:rgba(79,70,229,.18);
  --ok:#15803d; --ok-bg:#eef7f0;
  --warn:#b45309; --warn-bg:#fdf6ea;
  --danger:#b91c1c; --danger-bg:#fdefef;
  --info:#1d4ed8; --info-bg:#eef3fe;
  --radius-sm:8px;
  --radius:10px;
  --radius-lg:14px;
  --shadow-sm:0 1px 2px rgba(17,24,39,.05);
  --shadow:0 1px 3px rgba(17,24,39,.07),0 1px 2px rgba(17,24,39,.04);
  --shadow-lg:0 8px 24px rgba(17,24,39,.08),0 2px 6px rgba(17,24,39,.04);
}
*,*::before,*::after { box-sizing:border-box; }
body { margin:0; min-height:100vh; color:var(--ink); background:var(--bg);
  font:14px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,"PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased; }
a { color:var(--brand); text-decoration:none; text-underline-offset:3px; }
a:hover { text-decoration:underline; }
h1 { font-size:22px; font-weight:650; letter-spacing:-.02em; line-height:1.3; margin:0; }
h2 { font-size:15px; font-weight:600; letter-spacing:-.01em; margin:0; }
p { margin:0; }

/* 顶部导航 */
header { position:sticky; top:0; z-index:20; background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(8px); border-bottom:1px solid var(--border); }
header nav { width:min(1180px,100%); margin:auto; padding:0 clamp(16px,4vw,32px);
  height:60px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand { display:flex; align-items:center; gap:10px; font-size:15px; font-weight:650;
  color:var(--ink); letter-spacing:-.01em; }
.brand:hover { text-decoration:none; }
.brand .logo { width:28px; height:28px; border-radius:8px; background:var(--brand); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; }
.nav-links { display:flex; gap:6px; align-items:center; }
.nav-links > a { padding:7px 12px; border-radius:var(--radius-sm); color:var(--ink-2);
  font-size:13.5px; font-weight:500; }
.nav-links > a:hover { background:var(--surface-sub); color:var(--ink); text-decoration:none; }
.nav-links form { display:inline-flex; margin:0; }

/* 主内容区 */
main { width:min(1180px,100%); margin:auto; padding:28px clamp(16px,4vw,32px) 56px; }
.page-head { margin-bottom:24px; }
.page-head .sub { color:var(--muted); font-size:13.5px; margin-top:6px; }
main > h1 { margin-bottom:24px; }

/* 卡片 */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm); padding:22px; margin:0 0 18px; min-width:0; }
.card > h2 { margin-bottom:4px; }
.card .card-sub { color:var(--muted); font-size:13px; margin-bottom:18px; }
.card > h2 + *:not(.card-sub) { margin-top:16px; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:18px; }
.grid .card { margin-bottom:0; }

/* 表单 */
form { display:grid; gap:14px; }
form.compact { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
form.compact > label { flex:1 1 180px; }
label { display:grid; gap:6px; font-size:13px; font-weight:550; color:var(--ink-2); }
input, select { width:100%; min-height:40px; padding:9px 12px; background:var(--surface);
  color:var(--ink); border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  font:inherit; font-size:14px; transition:border-color .15s,box-shadow .15s; }
input::placeholder { color:var(--faint); }
input:hover, select:hover { border-color:var(--faint); }
input:focus, select:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring); }
select { appearance:none; padding-right:32px;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; }

/* 按钮 */
.button, button { display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:40px; padding:9px 16px; border:1px solid transparent; border-radius:var(--radius-sm);
  font:inherit; font-size:13.5px; font-weight:600; cursor:pointer; text-decoration:none;
  background:var(--brand); color:#fff; transition:background .15s,border-color .15s,box-shadow .15s; }
.button:hover, button:hover { background:var(--brand-hover); text-decoration:none; }
.button:active, button:active { transform:translateY(.5px); }
.button:focus-visible, button:focus-visible { outline:none; box-shadow:0 0 0 3px var(--brand-ring); }
.secondary { background:var(--surface); color:var(--ink-2); border-color:var(--border-strong); }
.secondary:hover { background:var(--surface-sub); color:var(--ink); }
.danger { background:var(--danger); color:#fff; }
.danger:hover { background:#a31515; }
.button.ghost { background:transparent; color:var(--ink-2); }
.button.ghost:hover { background:var(--surface-sub); }
button[disabled] { opacity:.55; cursor:not-allowed; }

/* 徽标 */
.badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:3px 10px;
  font-size:12px; font-weight:550; background:var(--surface-sub); color:var(--ink-2);
  border:1px solid var(--border); white-space:nowrap; }
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge.active { background:var(--ok-bg); color:var(--ok); border-color:transparent; }
.badge.pending { background:var(--warn-bg); color:var(--warn); border-color:transparent; }
.badge.rejected,.badge.frozen { background:var(--warn-bg); color:var(--warn); border-color:transparent; }
.badge.offboarded,.badge.banned { background:var(--danger-bg); color:var(--danger); border-color:transparent; }

/* 标签页 */
.tabs { display:flex; gap:4px; flex-wrap:wrap; margin:0 0 20px; padding:4px;
  background:var(--surface-sub); border:1px solid var(--border); border-radius:var(--radius); width:fit-content; }
.tabs a { padding:7px 14px; border-radius:var(--radius-sm); color:var(--ink-2); font-size:13.5px; font-weight:500; }
.tabs a:hover { background:var(--surface); text-decoration:none; }
.tabs [aria-current] { background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow-sm); }

/* 列表与记录 */
.listing { list-style:none; padding:0; margin:0; }
.listing li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:8px 16px; padding:12px 0; border-bottom:1px solid var(--border); font-size:13.5px; }
.listing li:last-child { border-bottom:0; }
.record { display:grid; gap:14px; padding:18px 0; border-top:1px solid var(--border); overflow-wrap:anywhere; }
.record:first-of-type { border-top:0; padding-top:6px; }
.record strong { font-size:14px; font-weight:600; }
.record .actions-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
time { color:var(--muted); font-size:12.5px; font-variant-numeric:tabular-nums; }
.muted { color:var(--muted); font-size:13px; }
.empty { text-align:center; padding:32px 16px; color:var(--muted); font-size:13.5px; }
.error { color:var(--danger); font-size:13.5px; }

/* 登录 / 二次口令：居中极简 */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:48px 20px; background:var(--bg); }
.auth-card { width:100%; max-width:380px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:32px 30px; }
.auth-card .auth-logo { display:flex; align-items:center; gap:9px; margin-bottom:26px; }
.auth-card .auth-logo .logo { width:28px; height:28px; border-radius:8px; background:var(--brand);
  color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; }
.auth-card .auth-logo span { font-weight:650; font-size:14px; }
.auth-card h1 { font-size:20px; margin-bottom:6px; }
.auth-card .auth-sub { color:var(--muted); font-size:13.5px; margin-bottom:24px; }
.auth-card .button { width:100%; min-height:42px; }
.auth-card .auth-foot { text-align:center; font-size:12.5px; color:var(--muted); margin-top:20px; }

/* 表单内按钮不撑满 */
form > button, form > .button { justify-self:start; }
.auth-card form > button { justify-self:stretch; width:100%; }
.field > span { font-size:13px; font-weight:550; color:var(--ink-2); }
form.stack { display:grid; gap:14px; }

/* 功能 Tab（下划线式） */
.tabs-bar { display:flex; gap:8px; margin:0 0 20px; border-bottom:1px solid var(--border); }
.tabs-bar button { background:none; border:none; border-bottom:2px solid transparent; color:var(--muted);
  padding:10px 14px; font-size:14px; font-weight:550; cursor:pointer; min-height:0; border-radius:0; }
.tabs-bar button:hover { color:var(--ink); background:none; }
.tabs-bar button.active { color:var(--brand); border-bottom-color:var(--brand); }

/* 工具栏 */
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.toolbar h2 { display:inline; }
.toolbar-sub { color:var(--muted); font-size:13px; margin-left:10px; }
.toolbar-actions { display:flex; gap:10px; align-items:center; }

/* 数据表格 */
.data-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.data-table th { text-align:left; font-weight:550; color:var(--muted); font-size:12.5px;
  padding:10px 12px; border-bottom:1px solid var(--border); }
.data-table td { padding:13px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.data-table th:first-child, .data-table td:first-child { padding-left:0; }
.data-table tbody tr:last-child td { border-bottom:0; }
.data-table tbody tr:hover { background:var(--surface-sub); }
.cell-strong { font-weight:600; color:var(--ink); }
.col-actions { text-align:right; white-space:nowrap; }
.col-actions > * + * { margin-left:14px; }

/* 文字按钮 / 链接按钮 */
.link { background:none; border:none; color:var(--brand); font-size:13px; font-weight:500;
  cursor:pointer; padding:2px 0; min-height:0; text-decoration:none; display:inline; }
.link:hover { text-decoration:underline; background:none; }
.danger-link { color:var(--danger); }
.link.disabled { color:var(--faint); cursor:not-allowed; text-decoration:none; }

/* 模态框 */
.modal-overlay { position:fixed; inset:0; background:rgba(17,24,39,.45);
  display:flex; align-items:center; justify-content:center; padding:24px; z-index:50; }
.modal { background:var(--surface); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  width:100%; max-width:440px; max-height:90vh; overflow:auto; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:20px 22px 0; }
.modal-head h3 { font-size:16px; font-weight:600; margin:0; }
.modal-close { background:none; border:none; font-size:22px; line-height:1; color:var(--muted);
  cursor:pointer; padding:2px 6px; min-height:0; border-radius:var(--radius-sm); }
.modal-close:hover { background:var(--surface-sub); color:var(--ink); }
.modal-body { padding:18px 22px 22px; }
.modal-body form { display:grid; gap:14px; }
.modal-body p { margin:0 0 4px; font-size:13.5px; }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }

/* 工具类（替代内联样式，规避严格 CSP） */
.inline-form { display:inline; }
.center { text-align:center; }
.mt-12 { margin-top:12px; }
.form-hint { color:var(--muted); font-size:13px; margin:0 0 12px; }
.apply-link { margin:0 0 14px; }

@media (max-width:640px) {
  main { padding:20px 16px 40px; }
  .card { padding:18px; }
  form.compact { flex-direction:column; align-items:stretch; }
  header nav { height:56px; }
}
