:root {
  --bg: #f5f6fa; --card: #fff; --line: #e8eaf2; --text: #23263b; --muted: #8b90a8;
  --brand: #7c5cff; --brand-2: #9f7bff; --brand-soft: #efEAff; --ok: #1fa971; --warn: #e6a23c; --bad: #e05d5d;
  --shadow: 0 6px 24px rgba(60, 60, 120, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 85% -10%, #e9e2ff 0%, var(--bg) 55%), radial-gradient(900px 500px at -10% 110%, #ffe9f4 0%, var(--bg) 50%); }
.login-card { width: 380px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 34px 32px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 26px; }
.logo-dot { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.login-brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #7c5cff22; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 10px; padding: 10px 16px;
  background: var(--brand); color: #fff; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.btn.block { width: 100%; justify-content: center; padding: 12px; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 6px 12px; border-radius: 8px; font-weight: 500; font-size: 13px; }
.btn.danger { background: #fdf0f0; color: var(--bad); border: 1px solid #f5d6d6; }
.hint { margin-top: 14px; color: var(--muted); font-size: 12px; text-align: center; }
.err { background: #fdf0f0; color: var(--bad); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
.okmsg { background: #eefaf4; color: var(--ok); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }

/* ===== 后台框架 ===== */
.layout { display: flex; min-height: 100vh; }
.side { width: 216px; background: linear-gradient(180deg, #2b2350, #241d44); color: #cfc9ee; flex-shrink: 0; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .login-brand { color: #fff; }
.side .login-brand small { color: #9d95c8; }
.nav-group { margin-top: 14px; }
.nav-group h4 { font-size: 11px; font-weight: 500; color: #8f87bd; padding: 0 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.nav-item:hover { background: #ffffff14; }
.nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; }
.main { flex: 1; padding: 18px 26px 40px; min-width: 0; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; display: flex; gap: 8px; align-items: center; }
.chip b { font-size: 13px; }
.chip small { color: var(--muted); }
.page-head { margin-bottom: 16px; }
.kicker { color: var(--brand); font-weight: 700; letter-spacing: 1px; font-size: 12px; }
.page-head h2 { font-size: 22px; margin-top: 2px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafbff; }
.seg button { border: none; background: transparent; padding: 8px 18px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--brand); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 800; margin: 6px 0 2px; font-family: ui-monospace, Consolas, monospace; }
.stat .foot { color: var(--muted); font-size: 12px; }
.quick-grid { display: flex; flex-wrap: wrap; gap: 10px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbff; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f2f8; vertical-align: top; }
.tbl tr:hover td { background: #fafaff; }
.tag { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.tag.green { background: #e8f7f0; color: var(--ok); } .tag.gray { background: #f0f1f6; color: var(--muted); }
.tag.blue { background: #e9efff; color: #4a6fdc; } .tag.red { background: #fdeeee; color: var(--bad); }
.tag.yellow { background: #fdf6e3; color: #b57d1e; } .tag.purple { background: #f0eaff; color: var(--brand); }
.link { color: var(--brand); cursor: pointer; text-decoration: none; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; width: 240px; outline: none; }
.search:focus { border-color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.toast { position: fixed; top: 18px; right: 18px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast div { background: #23263bee; color: #fff; border-radius: 10px; padding: 10px 16px; box-shadow: var(--shadow); animation: fadein .2s; }
.toast div.bad { background: #a83d3dee; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }
/* 弹窗 */
.modal-bg { position: fixed; inset: 0; background: #17192b66; display: flex; align-items: center; justify-content: center; z-index: 90; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 560px; max-width: 94vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 16px; font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid .field { margin-bottom: 6px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.placeholder-card { text-align: center; padding: 60px 20px; color: var(--muted); }
.placeholder-card .big { font-size: 42px; margin-bottom: 14px; }
