:root {
  --ink: #16202e;
  --muted: #6b7789;
  --line: #e3e8ef;
  --bg: #f5f7fa;
  --card: #ffffff;
  --brand: #1f3864;
  --accent: #2f6fed;
  --ok: #1a7f4b;
  --warn: #8a5a00;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 56px; background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .3px; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: #5ad1a5; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.nav a { color: #d8e3f8; text-decoration: none; }
.nav a:hover { color: #fff; }
.who { color: #eaf1ff; }
.who small { display: block; color: #9fb4d9; font-size: 11px; line-height: 1.2; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 40px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px; margin-bottom: 18px;
}
.panel h1 { font-size: 18px; margin: 0 0 6px; }
.panel h2 { font-size: 15px; margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

.login-card { max-width: 420px; margin: 40px auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 28px; text-align: center; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.qr-box { margin: 18px auto; width: 240px; height: 240px; border: 1px dashed var(--line);
  border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fbfcfe; }
.qr-box img { width: 232px; height: 232px; }
.qr-placeholder { color: var(--muted); font-size: 13px; padding: 20px; }
.status { font-size: 13px; color: var(--muted); min-height: 20px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.dev { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  display: grid; gap: 8px; }

button, .ghost {
  font: inherit; cursor: pointer; border-radius: 7px; padding: 8px 16px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; display: inline-block;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.ghost:hover, .ghost:hover { border-color: var(--accent); color: var(--accent); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button.link:hover { text-decoration: underline; }
.inline { display: inline; }

input, select {
  font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink); width: 100%;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.request-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink); }
.field > span { font-size: 12px; color: #5b6b80; font-weight: 500; letter-spacing: .2px; }
.field .opt {
  margin-left: 6px; font-size: 10px; color: #7b8794; font-weight: 400;
  background: #f1f4f9; border-radius: 10px; padding: 1px 7px;
}
.field select, .field input[type=text] {
  height: 40px; border-radius: 8px; border: 1px solid #d9e0ea; background: #fff;
  padding: 0 12px; font-size: 13px; color: var(--ink);
}
.field select:focus, .field input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); outline: none;
}
.picker-trigger { height: 40px; border-radius: 8px; background: #fff; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.form-hint { font-size: 12px; color: var(--muted); }
.filter-actions .primary { height: 40px; min-width: 120px; border-radius: 8px; }
.grant-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: #eef3fd; color: #2a4a8b; border-radius: 20px; padding: 2px 12px; font-size: 12px; }
.chip-warn { background: #fff3e0; color: #8a5a00; }
.archive-note { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.archive-note p { flex-basis: 100%; margin: 4px 0 0; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 4px; }
.tag.ok { background: #e6f4ec; color: var(--ok); }
.tag.off { background: #f1f2f4; color: var(--muted); }

.grid { width: 100%; border-collapse: collapse; margin-top: 12px; }
.grid th, .grid td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.grid th { color: var(--muted); font-weight: 500; font-size: 12px; }
.grid tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.row-actions { display: flex; gap: 12px; }

.alert { border-radius: 8px; padding: 14px 16px; margin: 14px 0; border: 1px solid; }
.alert p { margin: 4px 0 0; font-size: 13px; }
.alert.danger { background: #fdf1f0; border-color: #f3c9c5; color: #7a1d17; }
.alert.warn { background: #fff8e8; border-color: #f0dfb4; color: #6b4a00; }

/* 下拉选择器 */
.picker { position: relative; }
.picker-trigger {
  width: 100%; text-align: left; background: #fff; border: 1px solid #d9e0ea;
  border-radius: 8px; padding: 0 12px; font-size: 13px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.picker-trigger:hover { border-color: var(--accent); }
.picker-trigger::after { content: "▾"; margin-left: 8px; color: var(--muted); }
.picker-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  box-shadow: 0 10px 30px rgba(20, 35, 60, .14); min-width: 520px;
}
.picker-pop.multi { min-width: 340px; }
.shortcuts { display: flex; gap: 8px; margin-bottom: 10px; }
.shortcuts button { font-size: 12px; padding: 3px 10px; }
.cal-wrap { display: flex; gap: 18px; }
.cal { width: 240px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 13px; }
.cal-head button { border: 0; background: none; padding: 2px 8px; color: var(--muted); }
.cal table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: 11px; color: var(--muted); font-weight: 500; padding: 4px 0; }
.cal td { text-align: center; padding: 1px 0; font-size: 12px; height: 30px; cursor: pointer; }
.cal-day {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 28px; border-radius: 6px; cursor: pointer;
}
.cal td:hover .cal-day { background: #eef3fd; }
.cal-day.muted { color: #c3cad6; }
.cal-day.in-range { background: #e8f0ff; }
.cal-day.selected { background: var(--accent); color: #fff; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.picker-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.picker-foot button { font-size: 12px; padding: 4px 14px; }
.multi-list { max-height: 240px; overflow: auto; }
.multi-item {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 5px 4px; font-size: 13px; cursor: pointer;
}
.multi-item span { white-space: nowrap; }
.multi-item input[type=checkbox] { width: 16px; height: 16px; margin: 0; }
.multi-item:hover { background: #f7f9fc; }
.multi-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.month-grid button { padding: 8px 0; font-size: 13px; }
.month-grid button.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.st-queued { color: var(--warn); }
.st-running { color: var(--accent); }
.st-done { color: var(--ok); }
.st-failed { color: var(--danger); }

@media (max-width: 760px) {
  .filter-grid, .grant-form { grid-template-columns: 1fr; }
  .filter-actions { flex-direction: column; align-items: stretch; }
  .topbar { padding: 0 14px; }
  .wrap { padding: 18px 12px 40px; }
  .picker-pop { min-width: 0; width: 92vw; left: 0; }
  .cal-wrap { flex-direction: column; }
}
