/* 登录页 · 与 miniprogram login m-login--proto 对齐 */
:root {
  --proto-bg: #f4faff;
  --proto-text: #2f3242;
  --proto-text-secondary: #6f7485;
  --proto-text-muted: #9ea4b5;
  --proto-border: #e4f1fa;
  --proto-primary-dark: #5bafea;
  --gradient-primary: linear-gradient(135deg, #5bafea 0%, #8ccbfa 100%);
  --shadow-button: 0 8px 20px rgba(91, 175, 234, 0.24);
  --color-info-bg: #eaf6ff;
}

html,
body.m-login--proto {
  background: var(--proto-bg) !important;
  background-size: auto !important;
  animation: none !important;
  color: var(--proto-text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 20px 56px !important;
  box-sizing: border-box;
}

/* PC 插画页：Logo + 登录框落在画面中上部留白区 */
body.m-login--proto.m-login--pc-bg {
  background: #dceefb !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 0 20px 64px !important;
}

body.m-login--proto.m-login--pc-bg .m-login-panel {
  width: min(400px, 92vw);
  max-width: 400px;
  margin: clamp(88px, calc(20vh - 40px), 188px) auto 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1000;
}

body.m-login--proto.m-login--pc-bg .m-login-panel .container {
  width: 100%;
  max-width: none;
  margin: 0;
}

@media (max-height: 760px) and (min-width: 769px) {
  body.m-login--proto.m-login--pc-bg .m-login-panel {
    margin-top: clamp(56px, calc(14vh - 40px), 120px);
  }
}

body.m-login--proto:not(.m-login--pc-bg) .m-login-panel {
  position: relative;
  z-index: 1000;
  width: min(400px, 92vw);
  max-width: 400px;
  margin: 0 auto;
  flex-shrink: 0;
  transform: translateY(-20px);
}

body.m-login--proto:not(.m-login--pc-bg) {
  justify-content: center !important;
  padding: 24px 16px 56px !important;
  background: var(--proto-bg) !important;
}

body.m-login--proto .m-login-panel {
  position: relative;
  z-index: 1000;
}

body.m-login--proto.m-login--pc-bg .m-login-scene {
  display: block;
}

body.m-login--proto:not(.m-login--pc-bg) .m-login-scene {
  display: none;
}

body.m-login--proto.m-login--pc-bg .m-login-petals,
body.m-login--proto.m-login--pc-bg .bubble {
  display: none !important;
}

/* PC 蒲公英：左下 → 右上飘散 */
body.m-login--proto.m-login--pc-bg .m-login-dandelions {
  display: block;
}

body.m-login--proto:not(.m-login--pc-bg) .m-login-dandelions {
  display: none;
}

.m-login-dandelions {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.m-login-seed {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.55) 42%,
    rgba(255, 255, 255, 0.08) 72%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.55),
    0 0 2px rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: translate(0, 0);
  animation: mLoginDandelionDrift linear infinite;
  will-change: transform, opacity;
}

.m-login-seed::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 1px;
  height: 14px;
  transform: translateX(-50%) rotate(18deg);
  background: linear-gradient(to top, rgba(255, 255, 255, 0.45), transparent);
  opacity: 0.7;
}

.m-login-seed::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
  animation: mLoginDandelionWobble 2.4s ease-in-out infinite;
}

.m-login-seed--1 { left: 2%; bottom: 4%; width: 9px; height: 9px; animation-duration: 19s; animation-delay: 0s; }
.m-login-seed--2 { left: 6%; bottom: 8%; width: 11px; height: 11px; animation-duration: 22s; animation-delay: -3s; }
.m-login-seed--3 { left: 10%; bottom: 2%; width: 8px; height: 8px; animation-duration: 17s; animation-delay: -7s; }
.m-login-seed--4 { left: 14%; bottom: 10%; width: 12px; height: 12px; animation-duration: 24s; animation-delay: -11s; }
.m-login-seed--5 { left: 4%; bottom: 14%; width: 10px; height: 10px; animation-duration: 20s; animation-delay: -5s; }
.m-login-seed--6 { left: 8%; bottom: 18%; width: 7px; height: 7px; animation-duration: 16s; animation-delay: -14s; }
.m-login-seed--7 { left: 12%; bottom: 6%; width: 9px; height: 9px; animation-duration: 21s; animation-delay: -9s; }
.m-login-seed--8 { left: 16%; bottom: 12%; width: 11px; height: 11px; animation-duration: 23s; animation-delay: -16s; }
.m-login-seed--9 { left: 3%; bottom: 20%; width: 8px; height: 8px; animation-duration: 18s; animation-delay: -12s; }
.m-login-seed--10 { left: 18%; bottom: 5%; width: 10px; height: 10px; animation-duration: 25s; animation-delay: -18s; }

@keyframes mLoginDandelionDrift {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(0.85);
    opacity: 0;
  }
  8% {
    opacity: 0.85;
  }
  25% {
    transform: translate(28vw, -28vh) rotate(45deg) scale(1);
    opacity: 0.72;
  }
  50% {
    transform: translate(52vw, -52vh) rotate(95deg) scale(1.02);
    opacity: 0.58;
  }
  75% {
    transform: translate(78vw, -78vh) rotate(150deg) scale(0.96);
    opacity: 0.38;
  }
  100% {
    transform: translate(108vw, -108vh) rotate(210deg) scale(0.88);
    opacity: 0;
  }
}

@keyframes mLoginDandelionWobble {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(3px, -2px) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-login-seed,
  .m-login-seed::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

.m-login-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #eaf7ff;
}

.m-login-scene__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* 宽屏 PC：背景居中，与登录框对齐 */
@media (min-width: 1280px) {
  body.m-login--pc-bg .m-login-scene__img {
    object-position: center center;
  }
}

@media (min-width: 769px) and (max-width: 1279px) {
  body.m-login--pc-bg .m-login-scene__img {
    object-position: center center;
  }
}

/* 窄屏 / 平板竖屏：略偏右下，避免裁掉主角色 */
@media (max-width: 768px) {
  body.m-login--pc-bg .m-login-scene__img {
    object-position: 72% 38%;
  }
}

/* 超宽屏：限制过度拉伸，保持构图 */
@media (min-width: 1920px) {
  body.m-login--pc-bg .m-login-scene__img {
    object-position: 50% center;
    transform: scale(1.02);
    transform-origin: center center;
  }
}

/* 登录框区域轻微提亮；径向范围收窄，四周尽量透明 */
body.m-login--pc-bg .m-login-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 26% 34% at 50% 36%, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 38%),
    linear-gradient(180deg, rgba(234, 247, 255, 0.02) 0%, rgba(234, 247, 255, 0.05) 100%);
  pointer-events: none;
}

body.m-login--proto .container {
  position: relative;
  z-index: 1;
  width: min(400px, 92vw);
  max-width: 400px;
  margin: 0 auto;
  flex-shrink: 0;
}

body.m-login--proto.m-login--pc-bg .m-login-panel .container {
  width: 100%;
  max-width: none;
  margin: 0;
}

body.m-login--proto .bubble {
  display: none !important;
}

body.m-login--proto .m-login-title--brand {
  text-align: center;
  margin-bottom: 14px;
}

body.m-login--proto.m-login--pc-bg .m-login-title--brand {
  margin-bottom: 12px;
}

body.m-login--proto .m-login-title__logo {
  display: block;
  width: min(140px, 39vw);
  height: auto;
  margin: 0 auto;
}

body.m-login--proto .title {
  display: none;
}

body.m-login--proto .card {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(220, 238, 248, 0.62);
  box-shadow: 0 10px 30px rgba(140, 203, 250, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--proto-text);
}

body.m-login--proto .subtitle {
  color: var(--proto-text-secondary);
  text-shadow: none;
}

body.m-login--proto .role-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--proto-border);
  box-shadow: 0 8px 24px rgba(140, 203, 250, 0.12);
  padding: 14px 16px;
}

body.m-login--proto .role-card:hover,
body.m-login--proto .role-card:active {
  background: var(--color-info-bg);
  border-color: #d9eef9;
  transform: scale(0.98);
}

body.m-login--proto .role-card__icon-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
}

body.m-login--proto .role-card__body {
  flex: 1;
  min-width: 0;
}

body.m-login--proto .role-name {
  color: var(--proto-text) !important;
  font-size: 16px;
  margin-bottom: 4px;
  text-shadow: none;
}

body.m-login--proto .role-desc {
  color: var(--proto-text-secondary) !important;
  font-size: 12px;
  line-height: 1.4;
}

body.m-login--proto .role-icon {
  display: none;
}

body.m-login--proto .back-btn {
  background: var(--color-info-bg);
  color: var(--proto-primary-dark);
  border: 1px solid var(--proto-border);
}

body.m-login--proto .form-group label {
  color: var(--proto-text-secondary);
}

body.m-login--proto .form-input {
  background: #fff;
  border: 1px solid var(--proto-border);
  color: var(--proto-text);
}

body.m-login--proto .btn-primary {
  background: var(--gradient-primary) !important;
  box-shadow: var(--shadow-button) !important;
  border: none !important;
}

body.m-login--proto .btn-primary::before,
body.m-login--proto .btn-primary::after {
  display: none !important;
}

body.m-login--proto .btn-wechat-pc {
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.22);
}

body.m-login--proto .login-divider {
  color: var(--proto-text-muted);
}

body.m-login--proto .login-divider__line {
  background: var(--proto-border);
}

body.m-login--proto .footer-link {
  color: var(--proto-text-secondary);
}

body.m-login--proto .footer-link a {
  color: var(--proto-primary-dark);
}

body.m-login--proto .tips {
  background: var(--color-info-bg);
  border: 1px solid var(--proto-border);
  color: var(--proto-text-secondary);
}

body.m-login--proto .tips-title {
  color: var(--proto-text);
}

body.m-login--proto .beian-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  color: var(--proto-text-muted);
  text-shadow: none;
}

body.m-login--proto .beian-footer a {
  color: var(--proto-text-secondary);
  pointer-events: auto;
}

body.m-login--proto .auth-return-banner {
  color: #92400e;
}

body.m-login--proto #deviceHint,
body.m-login--proto .tips a {
  color: var(--proto-primary-dark);
}

body.m-login--proto.m-login--pc-bg .beian-footer {
  color: rgba(47, 50, 66, 0.72);
  text-shadow: none;
}

body.m-login--proto.m-login--pc-bg .beian-footer a {
  color: rgba(47, 50, 66, 0.82);
}

body.m-login--proto .m-login-petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

body.m-login--proto .m-login-petal {
  position: absolute;
  width: 14px;
  height: 18px;
  border-radius: 50% 0 50% 0;
  background: linear-gradient(135deg, #f8c7df, #bee9f6);
  opacity: 0.35;
  animation: mLoginPetal 14s linear infinite;
}

body.m-login--proto .m-login-petal--1 { left: 8%; animation-duration: 16s; }
body.m-login--proto .m-login-petal--2 { left: 22%; animation-duration: 13s; animation-delay: -4s; }
body.m-login--proto .m-login-petal--3 { left: 48%; animation-duration: 15s; animation-delay: -7s; }
body.m-login--proto .m-login-petal--4 { left: 68%; animation-duration: 12s; animation-delay: -2s; }
body.m-login--proto .m-login-petal--5 { left: 82%; animation-duration: 17s; animation-delay: -9s; }
body.m-login--proto .m-login-petal--6 { left: 36%; animation-duration: 14s; animation-delay: -11s; }

@keyframes mLoginPetal {
  0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  8% { opacity: 0.4; }
  100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}
