* { box-sizing: border-box; }
body {
  margin: 0;
  color: #192232;
  background: #f4f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
.login-body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #f5f7fb;
}
.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(36, 55, 78, .055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(36, 55, 78, .045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.2));
}
.login-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 34px 22px;
}
.login-header {
  width: min(100%, 760px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #17395a, #257a91 58%, #4f8a63);
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(31, 92, 120, .22);
}
.identity-title {
  font-weight: 800;
  color: #1d324a;
  font-size: 17px;
}
.identity-subtitle {
  margin-top: 3px;
  color: #7b8797;
  font-size: 12px;
}
.secure-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #cbdce6;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #315067;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(25, 38, 55, .06);
}
.card-kicker {
  color: #2a7f6f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.auth-panel {
  width: min(100%, 520px);
  min-height: 610px;
  background: #fff;
  border: 1px solid rgba(200, 215, 229, .9);
  box-shadow:
    0 30px 80px rgba(21, 39, 64, .16),
    0 2px 0 rgba(255,255,255,.9) inset;
  border-radius: 12px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 24px;
}
.card-head h1 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.2;
  color: #172033;
  letter-spacing: 0;
}
.qr-box {
  width: 320px;
  height: 320px;
  margin: 2px auto 22px;
  display: grid;
  place-items: center;
  border: 1px solid #d5e0ea;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0, #ffffff 58%, #f5f8fb 100%);
  border-radius: 14px;
  padding: 22px;
  box-shadow:
    0 16px 36px rgba(29, 52, 76, .13),
    0 0 0 8px #f4f8fb;
}
.qr-box img {
  width: 264px;
  height: 264px;
  display: block;
  image-rendering: crisp-edges;
}
.status {
  min-height: 36px;
  color: #4d5b6f;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  padding: 0 8px;
}
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #46556a;
  font-size: 14px;
  margin: 6px 0 22px;
}
.actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid #cbd7e6;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary {
  background: #1f5f87;
  color: #fff;
  border-color: #1f5f87;
  box-shadow: 0 10px 22px rgba(31, 95, 135, .22);
}
.btn.secondary {
  background: #fff;
  color: #24364f;
}
.route-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}
.route-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #627086;
  font-size: 12px;
  font-weight: 700;
}
.login-footer {
  color: #6a788a;
  font-size: 13px;
}
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid #dde6f0;
  background: #fff;
  gap: 24px;
}
.brand {
  font-weight: 800;
  color: #1b4f77;
}
.nav {
  display: flex;
  gap: 16px;
  color: #526175;
  font-size: 14px;
}
.nav a:hover { color: #1f78c8; }
.userbar {
  margin-left: auto;
  color: #526175;
  font-size: 14px;
}
.userbar a { margin-left: 12px; color: #1f78c8; }
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
}
.panel {
  background: #fff;
  border: 1px solid #dde6f0;
  border-radius: 8px;
  padding: 28px;
}
.eyebrow {
  color: #1f78c8;
  font-size: 13px;
  font-weight: 700;
}
.panel h1 {
  margin: 10px 0 10px;
  font-size: 28px;
  letter-spacing: 0;
}
.panel p {
  color: #526175;
  line-height: 1.7;
}
.panel-space {
  margin-top: 18px;
}
.notice {
  border: 1px solid #cfe6d8;
  background: #eef9f1;
  color: #1f6b3b;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
}
.notice.error {
  border-color: #f2c7c7;
  background: #fff1f1;
  color: #a33232;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.admin-form label {
  display: grid;
  gap: 7px;
  color: #526175;
  font-size: 13px;
  font-weight: 700;
}
.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfdbe8;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 0 12px;
  font: inherit;
}
.admin-form button {
  align-self: end;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 14px;
}
.admin-table th,
.admin-table td {
  text-align: left;
  border-bottom: 1px solid #e4ebf4;
  padding: 12px 10px;
  vertical-align: middle;
}
.admin-table th {
  color: #6b7889;
  background: #f8fafc;
  font-size: 12px;
}
.admin-table code {
  color: #17395a;
  background: #edf5f8;
  border-radius: 5px;
  padding: 3px 6px;
}
.inline-form {
  display: inline;
}
.inline-form button,
.text-danger {
  border: 0;
  background: transparent;
  color: #b23131;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.muted {
  color: #8b97a8;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 24px 0 0;
}
.meta-grid div {
  border: 1px solid #e4ebf4;
  border-radius: 6px;
  padding: 12px;
}
.meta-grid dt {
  color: #7a8798;
  font-size: 12px;
}
.meta-grid dd {
  margin: 6px 0 0;
  color: #172033;
  overflow-wrap: anywhere;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tool {
  display: block;
  border: 1px solid #dde6f0;
  background: #fff;
  border-radius: 8px;
  padding: 18px;
}
.tool strong { display: block; margin-bottom: 8px; }
.tool span {
  display: block;
  color: #6b7889;
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 820px) {
  .login-stage { justify-content: flex-start; padding: 20px 16px 28px; }
  .login-header { width: 100%; }
  .secure-badge { display: none; }
  .auth-panel { min-height: auto; padding: 24px 18px; }
  .card-head h1 { font-size: 26px; }
  .qr-box { width: 276px; height: 276px; padding: 18px; }
  .qr-box img { width: 228px; height: 228px; }
  .actions { grid-template-columns: 1fr; }
  .route-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form { grid-template-columns: 1fr; }
  .meta-grid, .tool-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
}
