:root {
  --ppj-red: #e4002b;
  --ppj-red-dark: #b80022;
  --ppj-yellow: #ffbc0d;
  --page: #f5f5f7;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #6b7280;
  --line: #e4e5e7;
  --soft-red: #fff2f4;
  --error: #c9253c;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "PingFang SC", "Microsoft YaHei", "Aptos", sans-serif;
  line-height: 1.45;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-shell {
  display: grid;
  grid-template-rows: 68px 1fr;
  min-height: 100vh;
  opacity: 1;
  transition: opacity 160ms ease;
}

.intro-active .site-shell { opacity: 0; }

.site-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.wordmark { display: inline-flex; width: 112px; }
.wordmark img { display: block; width: 100%; height: auto; }

.login-layout {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 68px);
  padding: 36px 18px;
}

.access-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(420px, 100%);
  min-width: 0;
  padding: 32px 34px 24px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(32, 33, 36, 0.07);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head > span {
  width: 5px;
  height: 25px;
  flex: none;
  background: var(--ppj-red);
  border-radius: 2px;
}

.panel-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
}

form {
  display: grid;
  align-content: center;
  gap: 20px;
  width: 100%;
  margin: 30px auto 26px;
}

.field { display: grid; gap: 8px; }

.field label {
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid #d5d7da;
  border-radius: 6px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus {
  border-color: var(--ppj-red);
  box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

.field input[aria-invalid="true"] { border-color: var(--error); }

.password-control { position: relative; }
.password-control input { padding-right: 48px; }

.icon-button {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.icon-button:focus-visible { outline: 2px solid var(--ppj-red); outline-offset: -3px; }
.eye-closed { display: none; }
.password-visible .eye-open { display: none; }
.password-visible .eye-closed { display: block; }

.form-status {
  min-height: 19px;
  margin-top: -6px;
  color: var(--error);
  font-size: 13px;
}

.form-status.is-loading { color: var(--muted); }

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--ppj-red);
  border: 1px solid var(--ppj-red);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.submit-button:hover { background: var(--ppj-red-dark); border-color: var(--ppj-red-dark); }
.submit-button:active { transform: translateY(1px); }
.submit-button:focus-visible { outline: 3px solid rgba(228, 0, 43, 0.25); outline-offset: 2px; }
.submit-button:disabled { color: #ffffff; background: #c9cbd0; border-color: #c9cbd0; cursor: wait; transform: none; }

.access-panel footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding-top: 17px;
  color: #8a8f98;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.xpay-intro {
  position: fixed;
  z-index: 999;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.intro-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 750;
  animation: intro-fade 380ms ease forwards;
}

.intro-layer img { display: none; }
.intro-layer--dark { z-index: 2; color: #ffffff; background: var(--ppj-red); animation-delay: 260ms; }
.intro-layer--lime { z-index: 1; color: var(--ppj-red); background: var(--panel); animation-delay: 390ms; }
.intro-layer--lime span { transform: none; }

@keyframes intro-fade {
  to { opacity: 0; visibility: hidden; }
}

@media (max-width: 480px) {
  .site-shell { grid-template-rows: 62px 1fr; }
  .wordmark { width: 104px; }
  .login-layout { min-height: calc(100vh - 62px); padding: 22px 14px; }
  .access-panel { padding: 27px 21px 21px; }
  .panel-head h2 { font-size: 20px; }
  form { margin: 27px auto 24px; }
  .intro-layer { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .xpay-intro { display: none; }
  .intro-active .site-shell { opacity: 1; }
}
