:root {
  --p-blue: #1a5cff;
  --p-blue-dark: #0e3eb8;
  --p-blue-soft: rgba(26, 92, 255, 0.08);
  --p-sky: #e8f0ff;
  --p-bg: #f4f7fc;
  --p-card: #ffffff;
  --p-text: #0f1b33;
  --p-muted: #6b7a99;
  --p-line: #d9e2f2;
  --p-green: #0f9d6e;
  --p-red: #d64545;
  --p-radius: 14px;
  --p-shadow: 0 10px 30px rgba(15, 40, 90, 0.08);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--font);
}
a { color: var(--p-blue); text-decoration: none; }
button, input, select { font: inherit; }

.p-shell { min-height: 100vh; display: flex; flex-direction: column; }
.p-top {
  background: #fff;
  border-bottom: 1px solid var(--p-line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.p-top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.p-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--p-text);
  letter-spacing: .02em;
}
/* UEX 品牌标（与移动端/前台一致） */
.p-brand-mark {
  width: 26px;
  height: 25px;
  position: relative;
  flex: 0 0 auto;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
  border-bottom: 5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 15px 15px;
  box-sizing: border-box;
  color: inherit;
}
.p-brand-mark::before,
.p-brand-mark::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.p-brand-mark::before {
  width: 5px;
  height: 11px;
  right: -5px;
  top: -1px;
  border-radius: 0 0 3px 3px;
}
.p-brand-mark::after {
  width: 4px;
  height: 4px;
  left: 9px;
  top: -9px;
  border-radius: 1px;
  box-shadow: 6px 3px 0 currentColor, 12px 7px 0 currentColor, 6px -5px 0 currentColor;
}
@keyframes pLogoTint {
  0%, 100% { color: var(--p-text); filter: drop-shadow(0 0 0 rgba(5, 195, 221, 0)); }
  50% { color: #05c3dd; filter: drop-shadow(0 0 12px rgba(5, 195, 221, .35)); }
}
@keyframes pLogoBits {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(1px, -2px); }
  70% { transform: translate(-1px, 1px); }
}
.p-brand.p-brand-live {
  animation: pLogoTint 2.8s ease-in-out infinite;
}
.p-brand.p-brand-live .p-brand-mark::after {
  animation: pLogoBits 1.8s ease-in-out infinite;
}
.p-login-card .p-brand.p-brand-live {
  transform: scale(1.12);
  transform-origin: left center;
  margin-bottom: 18px;
}
.p-lang {
  display: inline-flex;
  border: 1px solid var(--p-line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.p-lang-btn {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--p-muted);
  cursor: pointer;
}
.p-lang-btn.active {
  background: var(--p-blue-soft);
  color: var(--p-blue);
}
.p-login-lang {
  position: absolute;
  top: 18px;
  right: 18px;
}
.p-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.p-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--p-muted);
  font-weight: 600;
  font-size: 14px;
}
.p-nav a.active, .p-nav a:hover {
  background: var(--p-blue-soft);
  color: var(--p-blue);
}
.p-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--p-muted);
  font-size: 13px;
}
.p-main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
}

.p-hero {
  background: linear-gradient(135deg, #1a5cff 0%, #3b82f6 55%, #60a5fa 100%);
  color: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--p-shadow);
  margin-bottom: 22px;
}
.p-hero h1 { margin: 0 0 8px; font-size: 26px; }
.p-hero p { margin: 0; opacity: .92; font-size: 14px; }

.p-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.p-stat {
  background: var(--p-card);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  padding: 18px 16px;
  box-shadow: var(--p-shadow);
}
.p-stat .k { color: var(--p-muted); font-size: 12px; font-weight: 600; }
.p-stat .v { margin-top: 8px; font-size: 22px; font-weight: 800; color: var(--p-text); }
.p-stat .v.accent { color: var(--p-blue); }
.p-stat .v.green { color: var(--p-green); }

.p-card {
  background: var(--p-card);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.p-card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--p-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.p-card-head h2 { margin: 0; font-size: 16px; }
.p-card-body { padding: 16px 18px; }

.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--p-line);
  background: #fff;
  color: var(--p-text);
  font-weight: 700;
  cursor: pointer;
}
.p-btn.primary {
  background: var(--p-blue);
  border-color: var(--p-blue);
  color: #fff;
}
.p-btn.primary:hover { background: var(--p-blue-dark); }
.p-btn:disabled { opacity: .55; cursor: not-allowed; }
.p-btn.block { width: 100%; }

.p-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-table th, .p-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--p-line);
  text-align: left;
  vertical-align: top;
}
.p-table th { color: var(--p-muted); font-weight: 700; background: #f8faff; }
.p-table tr:last-child td { border-bottom: 0; }
.p-empty { color: var(--p-muted); text-align: center; padding: 28px 12px; }

.p-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--p-line);
  background: #fafcff;
}
.p-pager[hidden] { display: none !important; }
.p-pager-btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}
.p-pager-info {
  min-width: 140px;
  text-align: center;
  font-size: 13px;
  color: var(--p-muted);
  font-weight: 600;
}

.p-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--p-sky);
  color: var(--p-blue);
}
.p-badge.ok { background: rgba(15,157,110,.12); color: var(--p-green); }
.p-badge.warn { background: rgba(214,69,69,.1); color: var(--p-red); }

/* login */
.p-login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 20%, rgba(26,92,255,.16), transparent 34%),
    radial-gradient(circle at 88% 80%, rgba(96,165,250,.18), transparent 32%),
    linear-gradient(180deg, #eef3ff 0%, #f7f9fc 100%);
}
.p-login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--p-line);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(20, 50, 120, .12);
}
.p-login-card h1 { margin: 0 0 6px; font-size: 24px; }
.p-login-card .sub { margin: 0 0 22px; color: var(--p-muted); font-size: 14px; }
.p-field { display: grid; gap: 6px; margin-bottom: 14px; }
/* display:grid 会盖掉 UA 的 [hidden]，2FA 框需显式隐藏 */
.p-field[hidden] { display: none !important; }
.p-field label { font-size: 13px; color: var(--p-muted); font-weight: 600; }
.p-input {
  height: 42px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--p-text);
}
.p-input:focus {
  outline: none;
  border-color: var(--p-blue);
  box-shadow: 0 0 0 3px var(--p-blue-soft);
}
.p-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #122044;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 50;
  max-width: 90vw;
}
.p-toast.error { background: var(--p-red); }

.p-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.p-filters select {
  height: 36px;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

@media (max-width: 900px) {
  .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-top-inner { flex-wrap: wrap; }
  .p-nav { order: 3; width: 100%; }
}
@media (max-width: 640px) {
  .p-grid { grid-template-columns: 1fr; }
  .p-hero h1 { font-size: 22px; }
  .p-table { display: block; overflow-x: auto; }
  .p-user span.hide-sm { display: none; }
}
