:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #16202b;
  --muted: #67727f;
  --line: #e4e9ee;
  --accent: #0f9d76;      /* 翡翠绿主色 */
  --accent-weak: #e2f6ef;
  --accent-deep: #0b7d5e;
  --sidebar: #17202c;
  --sidebar-ink: #aeb9c7;
  --sidebar-active: #0f9d76;
  --ok: #0f9d76;
  --err: #d64545;
  --warn: #c77b14;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
}
a { color: var(--accent-deep); }
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.brand .name { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand .sub { font-size: 11px; color: #7b8794; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px; color: var(--sidebar-ink);
  text-decoration: none; font-size: 14px; border: 0; background: transparent; text-align: left; width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(15,157,118,.18); color: #fff; }
.nav-item .ico { width: 18px; text-align: center; }
.sidebar .foot { margin-top: auto; padding: 10px; font-size: 11.5px; color: #5d6a78; }
.sidebar .who { margin-top: 8px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: #cbd5df; }
.sidebar .who .btn { margin-top: 8px; }

.main { flex: 1; min-width: 0; width: 100%; max-width: 1440px; margin: 0 auto; padding: 22px 26px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.pill.admin { background: #efe7ff; color: #6d3fc0; }
.pill.user { background: var(--accent-weak); color: var(--accent-deep); }

/* ---------- 桌面端专用(仅支持电脑浏览器; 不做手机适配) ---------- */
/* 桌面窗口拖窄时, 列表在卡片内横向滚动, 不改变整体布局 */

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16,32,64,.04); }
.card h2 { font-size: 15.5px; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 12.5px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { padding: 4px 2px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 30px; font-weight: 800; margin: 2px 0; }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .delta { font-size: 12px; color: var(--muted); }

/* ---------- 表单 ---------- */
/* 宽度/内边距只作用于文本类控件; radio/checkbox 保持原生尺寸, 否则会在行内布局中被拉伸导致文字竖排 */
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%; padding: 9px 11px; margin: 6px 0 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit; background: #fbfcfd;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: 13px; }
/* 弹窗表单: 标签左、控件右的两列对齐(对标上游编辑弹窗) */
.form-grid { display: grid; grid-template-columns: 132px 1fr; gap: 2px 12px; align-items: center; margin: 2px 0 4px; }
.form-grid > label { margin: 0; }
.form-grid select, .form-grid input { margin: 0; }
.status-radios { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.radio input { width: 14px; height: 14px; margin: 0; flex: none; accent-color: var(--accent, #3b82f6); }
.btn { border: 0; border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.primary:disabled { background: #9ed7c5; cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: #b9c2cc; }
.btn.danger { background: #fdecec; color: var(--err); }
.btn.danger:hover { background: #f8d9d9; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.msg { min-height: 20px; font-size: 13px; margin: 4px 0; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7f9fb; font-weight: 600; color: #4a5663; }
td.wrap { white-space: normal; word-break: break-all; max-width: 320px; }
tr:hover td { background: #fafcfd; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: 13px; }
.tab.active { background: var(--accent-weak); color: var(--accent-deep); border-color: var(--accent); font-weight: 600; }
.st-pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.st-0 { background: #fff3df; color: var(--warn); }
.st-1 { background: #e3f5ec; color: var(--ok); }
.st-2 { background: #fdeaea; color: var(--err); }

/* ---------- 登录页(居中卡片) ---------- */
.login-body { background: var(--sidebar); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 16px; padding: 28px 26px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.brand.center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.brand.center .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 700; }
.brand.center .name { color: var(--ink); font-weight: 800; font-size: 20px; }
.brand.center .sub { color: var(--muted); font-size: 12.5px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(10,16,24,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 460px; padding: 20px 22px; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); }
