:root {
  --ywp-navy: #07172c;
  --ywp-navy-soft: #102846;
  --ywp-signal: #e87836;
  --ywp-action: #a43a2a;
  --ywp-gold: #efb64f;
  --ywp-paper: #f7f8fa;
  --ywp-ink: #111b2b;
  --ywp-muted: #667287;
  --ywp-line: #d9e0e8;
}

body.ywp-dialog-open {
  overflow: hidden !important;
}

.ywp-overlay[hidden],
.ywp-panel[hidden],
.ywp-qr-image[hidden],
.ywp-binding-code[hidden],
.ywp-button[hidden] {
  display: none !important;
}

.ywp-overlay {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 11, 23, .72);
  backdrop-filter: blur(12px);
  animation: ywp-overlay-in .18s ease-out;
}

.ywp-dialog {
  position: relative;
  display: grid;
  width: min(920px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  overflow: auto;
  color: var(--ywp-ink);
  background: var(--ywp-paper);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 22px;
  box-shadow: 0 32px 100px rgba(1, 8, 20, .42);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  animation: ywp-dialog-in .22s cubic-bezier(.2, .78, .2, 1);
}

.ywp-identity {
  position: relative;
  min-height: 610px;
  padding: 38px 32px 32px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 84% 15%, rgba(239, 182, 79, .2), transparent 30%),
    linear-gradient(150deg, var(--ywp-navy-soft), var(--ywp-navy) 64%);
}

.ywp-identity::after {
  content: "坞";
  position: absolute;
  right: -28px;
  bottom: -65px;
  color: rgba(255, 255, 255, .035);
  font-family: "Songti SC", "STSong", serif;
  font-size: 230px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.ywp-identity-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: .04em;
}

.ywp-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ywp-gold);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
}

.ywp-eyebrow {
  margin: 58px 0 12px;
  color: #93a7bf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.ywp-identity h2 {
  max-width: 270px;
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.16;
  letter-spacing: -.035em;
}

.ywp-identity-copy {
  margin: 22px 0 0;
  color: #b9c7d7;
  font-size: 14px;
  line-height: 1.75;
}

.ywp-trust-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 44px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
  list-style: none;
}

.ywp-trust-list li {
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 8px;
  color: #d1dbe6;
  font-size: 12px;
  line-height: 1.5;
}

.ywp-trust-list li span {
  color: var(--ywp-gold);
  font-weight: 900;
}

.ywp-content {
  position: relative;
  padding: 34px 42px 36px;
}

.ywp-close {
  position: absolute;
  top: 22px;
  right: 24px;
  min-width: 46px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ywp-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ywp-close:hover {
  color: var(--ywp-ink);
  background: #e9edf2;
}

.ywp-tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 27px;
  padding: 4px;
  background: #e9edf2;
  border-radius: 10px;
}

.ywp-tabs button {
  min-height: 44px;
  padding: 0 15px;
  color: var(--ywp-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ywp-tabs button[aria-selected="true"] {
  color: var(--ywp-ink);
  background: #fff;
  box-shadow: 0 3px 10px rgba(17, 27, 43, .08);
}

.ywp-title {
  margin: 0;
  color: var(--ywp-ink);
  font-family: inherit;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.ywp-description {
  max-width: 560px;
  margin: 10px 0 26px;
  color: var(--ywp-muted);
  font-size: 13px;
  line-height: 1.65;
}

.ywp-qr-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.ywp-qr-shell {
  position: relative;
  display: grid;
  width: 230px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, #cdd6e1, #edf0f4) border-box;
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(10, 23, 43, .1);
}

.ywp-qr-shell::before,
.ywp-qr-shell::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-color: var(--ywp-signal);
  pointer-events: none;
}

.ywp-qr-shell::before {
  top: 12px;
  left: 12px;
  border-top: 3px solid var(--ywp-signal);
  border-left: 3px solid var(--ywp-signal);
  border-radius: 4px 0 0;
}

.ywp-qr-shell::after {
  right: 12px;
  bottom: 12px;
  border-right: 3px solid var(--ywp-signal);
  border-bottom: 3px solid var(--ywp-signal);
  border-radius: 0 0 4px;
}

.ywp-qr-image {
  width: 100%;
  height: 100%;
  padding: 15px;
  object-fit: contain;
  background: #fff;
}

.ywp-scan-line {
  position: absolute;
  z-index: 3;
  left: 20px;
  right: 20px;
  top: 22px;
  height: 2px;
  opacity: 0;
  background: var(--ywp-signal);
  box-shadow: 0 0 10px rgba(232, 120, 54, .65);
  pointer-events: none;
}

.ywp-qr-shell[data-state="pending"] .ywp-scan-line,
.ywp-qr-shell[data-state="scanned"] .ywp-scan-line {
  opacity: 1;
  animation: ywp-scan 2.2s ease-in-out infinite;
}

.ywp-qr-placeholder {
  position: absolute;
  z-index: 0;
  color: #8995a6;
  font-size: 12px;
  font-weight: 700;
}

.ywp-qr-shell[data-state="approved"] {
  border-color: #6fb78b;
}

.ywp-login-copy {
  min-width: 0;
}

.ywp-step-label {
  margin: 0 0 12px;
  color: var(--ywp-ink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.ywp-steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ywp-step;
}

.ywp-steps li {
  position: relative;
  min-height: 29px;
  padding-left: 40px;
  color: #46546a;
  font-size: 13px;
  line-height: 1.55;
  counter-increment: ywp-step;
}

.ywp-steps li::before {
  content: counter(ywp-step);
  position: absolute;
  top: -3px;
  left: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #526177;
  background: #e9edf2;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 850;
}

.ywp-binding-code {
  margin-top: 18px;
  padding: 12px 14px;
  color: #7f431f;
  background: #fff1e7;
  border: 1px solid #f0c6a9;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .06em;
}

.ywp-status {
  min-height: 44px;
  margin: 24px 0 0;
  padding: 12px 14px;
  color: #526177;
  background: #edf1f5;
  border-left: 3px solid #98a5b5;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  line-height: 1.6;
}

.ywp-status[data-state="scanned"],
.ywp-status[data-state="pending"] {
  color: #71401f;
  background: #fff3e9;
  border-color: var(--ywp-signal);
}

.ywp-status[data-state="approved"] {
  color: #285d3d;
  background: #eaf5ee;
  border-color: #4c9a68;
}

.ywp-status[data-state="error"],
.ywp-status[data-state="expired"] {
  color: #7a3030;
  background: #fbecec;
  border-color: #c75b5b;
}

.ywp-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
}

.ywp-button,
.ywp-link-button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ywp-button-primary {
  color: #fff;
  background: var(--ywp-action);
  border: 1px solid var(--ywp-action);
}

.ywp-link-button {
  padding: 0;
  color: #315a88;
  background: transparent;
  border: 0;
}

.ywp-registration-qr {
  overflow: visible;
}

.ywp-static-label {
  position: absolute;
  left: 50%;
  bottom: -12px;
  z-index: 4;
  transform: translateX(-50%);
  padding: 5px 9px;
  color: #fff;
  background: var(--ywp-navy-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.ywp-static-notice {
  margin: 17px 0;
  color: var(--ywp-muted);
  font-size: 11px;
  line-height: 1.6;
}

.ywp-close:focus-visible,
.ywp-tabs button:focus-visible,
.ywp-button:focus-visible,
.ywp-link-button:focus-visible {
  outline: 3px solid rgba(232, 120, 54, .42);
  outline-offset: 3px;
}

/* 验证码登录面板 */
.ywp-sms-form {
  display: grid;
  gap: 10px;
}

.ywp-field-label {
  margin: 4px 0 -2px;
  color: var(--ywp-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.ywp-sms-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.ywp-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--ywp-ink);
  background: #fff;
  border: 1px solid var(--ywp-line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  letter-spacing: .02em;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.ywp-input:focus {
  outline: none;
  border-color: var(--ywp-signal);
  box-shadow: 0 0 0 3px rgba(232, 120, 54, .18);
}

.ywp-input::placeholder {
  color: #98a5b5;
}

.ywp-button-secondary {
  color: var(--ywp-action);
  background: #fff;
  border: 1px solid var(--ywp-action);
}

.ywp-button-secondary:hover:not([disabled]) {
  color: #fff;
  background: var(--ywp-action);
}

.ywp-button[disabled],
.ywp-button-secondary[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.ywp-sms-status {
  margin: 6px 0 0;
}

.ywp-sms-status[data-state="loading"] {
  color: #355a85;
  background: #eaf0fa;
  border-color: #6f97c4;
}

/* 已登录用户菜单 */
.ywp-user-menu {
  position: fixed;
  z-index: 2147483001;
  width: 220px;
  padding: 16px 18px 14px;
  color: var(--ywp-ink);
  background: var(--ywp-paper);
  border: 1px solid rgba(17, 27, 43, .08);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(1, 8, 20, .22);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  animation: ywp-overlay-in .15s ease-out;
}

.ywp-user-menu-header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ywp-line);
}

.ywp-user-menu-name {
  margin: 0;
  color: var(--ywp-ink);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.01em;
  word-break: break-all;
}

.ywp-user-menu-meta {
  margin: 4px 0 0;
  color: var(--ywp-muted);
  font-size: 12px;
}

.ywp-user-menu-actions {
  display: grid;
  gap: 8px;
}

.ywp-user-menu .ywp-button {
  width: 100%;
}

@keyframes ywp-overlay-in {
  from { opacity: 0; }
}

@keyframes ywp-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
}

@keyframes ywp-scan {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(180px); }
}

@media (max-width: 760px) {
  .ywp-overlay {
    align-items: end;
    padding: 12px;
  }

  .ywp-dialog {
    max-height: calc(100dvh - 24px);
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .ywp-identity {
    min-height: auto;
    padding: 22px 24px;
  }

  .ywp-identity .ywp-eyebrow,
  .ywp-identity-copy,
  .ywp-trust-list {
    display: none;
  }

  .ywp-identity h2 {
    max-width: none;
    margin-top: 14px;
    font-size: 21px;
  }

  .ywp-content {
    padding: 22px 24px 30px;
  }

  .ywp-close {
    top: 16px;
    right: 18px;
  }

  .ywp-tabs {
    margin-bottom: 20px;
  }

  .ywp-description {
    margin-bottom: 20px;
  }
}

@media (max-width: 560px) {
  .ywp-qr-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ywp-qr-shell {
    width: min(230px, 72vw);
    margin-inline: auto;
  }

  .ywp-login-copy {
    max-width: 340px;
    margin-inline: auto;
  }

  .ywp-status {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ywp-overlay,
  .ywp-dialog,
  .ywp-scan-line {
    animation: none !important;
    transition: none !important;
  }
}
