:root {
  --page: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #fbfcfe;
  --text: #17202f;
  --heading: #0d1523;
  --muted: #6f7b8d;
  --faint: #9aa4b2;
  --line: #e7ebf1;
  --line-soft: #f0f3f7;
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --primary-soft: #eef4ff;
  --green: #0f8a5f;
  --green-soft: #edf8f3;
  --red: #c43f45;
  --red-soft: #fff1f2;
  --amber: #9a6700;
  --amber-soft: #fff8e7;
  --shadow: 0 18px 50px rgba(18, 32, 54, .07);
  --shadow-subtle: 0 1px 2px rgba(18, 32, 54, .04);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
img { max-width: 100%; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #d5dce7; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
input[type="file"] {
  background: var(--panel-soft);
  border-style: dashed;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
label {
  display: block;
  margin: 14px 0 6px;
  color: #3f4b5d;
  font-size: 13px;
  font-weight: 650;
}
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .14);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}
button:hover, .btn:hover {
  background: var(--primary-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}
.btn.ghost, button.ghost {
  color: #244a90;
  background: #fff;
  border-color: #dbe4f2;
  box-shadow: none;
}
.btn.ghost:hover, button.ghost:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #cbd9f3;
  box-shadow: none;
}
.btn.danger, button.danger {
  background: #fff;
  color: var(--red);
  border-color: #f2c8cc;
  box-shadow: none;
}
.btn.danger:hover, button.danger:hover {
  background: var(--red-soft);
  color: #a92f35;
  box-shadow: none;
}
.btn.small, button.small {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, #fbfcff 0%, #f3f6fa 100%);
}
.login-card {
  position: relative;
  width: min(420px, calc(100vw - 36px));
  padding: 36px;
  border: 1px solid rgba(224, 230, 240, .9);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 80px rgba(20, 35, 58, .1);
}
.login-card::before {
  content: "满";
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  border-radius: 16px;
  color: #fff;
  background: #17202f;
  font-size: 24px;
  font-weight: 800;
}
.login-card h1 {
  margin: 0;
  color: var(--heading);
  font-size: 28px;
  font-weight: 760;
  letter-spacing: 0;
}
.login-card p { margin: 8px 0 26px; color: var(--muted); }
.login-card button { width: 100%; height: 42px; margin-top: 20px; }
.login-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  text-align: center;
  font-size: 12px;
}
.error, .notice {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  font-weight: 600;
}
.error { color: var(--red); background: var(--red-soft); border: 1px solid #ffd9dd; }
.notice { color: var(--green); background: var(--green-soft); border: 1px solid #cfecdf; }

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  background: #fbfcfe;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 22px;
  margin-bottom: 18px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #17202f;
  color: #fff;
  font-weight: 760;
}
.brand strong {
  display: block;
  color: var(--heading);
  font-size: 17px;
  font-weight: 760;
}
.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.menu-group {
  margin: 18px 0 7px;
  padding: 0 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 720;
}
.menu a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #4b5870;
  font-weight: 650;
  transition: background .14s ease, color .14s ease;
}
.menu a:hover { background: #f1f5f9; color: var(--heading); }
.menu a.active {
  background: #eef4ff;
  color: var(--primary);
}
.menu-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c6cfdd;
  flex: 0 0 auto;
}
.menu a.active .menu-icon { background: var(--primary); }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(246, 247, 249, .88);
  border-bottom: 1px solid rgba(231, 235, 241, .82);
  backdrop-filter: blur(16px);
}
.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
}
.topbar-title span {
  color: var(--heading);
  font-weight: 720;
}
.topbar-title b {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3f4b5d;
  font-weight: 650;
}
.avatar-mini {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--heading);
  font-size: 13px;
}
.logout-link {
  margin-left: 6px;
  color: var(--muted);
}
.content {
  width: min(1440px, 100%);
  padding: 28px 34px 46px;
}
.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.breadcrumb {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
}
.page-hero h1 {
  margin: 0;
  color: var(--heading);
  font-size: 30px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.15;
}
.page-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.hero-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 16px;
}
.section-title h2 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  font-weight: 730;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
}
.card h2 {
  margin: 0 0 16px;
  color: var(--heading);
  font-size: 16px;
  font-weight: 730;
}
.card > h2:first-child {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.stat {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}
.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.stat b {
  color: var(--heading);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 760;
}
.stat small { color: var(--faint); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.quick-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}
.quick-card b {
  display: block;
  margin-bottom: 7px;
  color: var(--heading);
  font-size: 15px;
}
.quick-card span {
  display: block;
  min-height: 42px;
  color: var(--muted);
  line-height: 1.65;
}
.quick-card .btn { margin-top: 14px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}
.card .table-wrap { box-shadow: none; }
table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
th {
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}
td { color: #273349; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fcfdff; }
td.actions { white-space: nowrap; }
td.actions form { display: inline; margin-left: 6px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.help {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.hint-box {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #dce8fb;
  border-radius: 10px;
  background: #f7faff;
  color: #40516b;
  line-height: 1.7;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 720;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.off {
  background: #f2f4f7;
  color: #707b8e;
}
.pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}
.thumb {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
}
.tabs {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.tabs a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}
.tabs a.active {
  color: var(--heading);
  background: #f1f5f9;
}
.two-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}
.two-pane > .card,
.two-pane > form.card {
  position: sticky;
  top: 86px;
}
.muted { color: var(--muted); }
.danger-text { color: var(--red); }
.code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f3f5f8;
  color: #44546a;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 1; }
  .two-pane { grid-template-columns: 1fr; }
  .two-pane > .card, .two-pane > form.card { position: static; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .topbar { position: static; padding: 0 18px; }
  .content { padding: 20px 18px 34px; }
  .page-hero { flex-direction: column; align-items: flex-start; }
  .quick-grid, .grid, .filters, .form-row, .form-row.three { grid-template-columns: 1fr; }
}
