/* Mellson homepage override. Loaded after the main app stylesheet. */
.home-page {
  min-height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 137, 255, .10), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f3f8ff 48%, #eef6ff 100%) !important;
  color: #101827;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.home-shell {
  width: min(1790px, calc(100vw - 96px));
  min-height: 100%;
  margin: 0 auto;
  padding: 26px 0 56px !important;
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  gap: 36px !important;
}

.home-head {
  height: 82px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.home-head .brand-logo {
  width: clamp(230px, 15vw, 300px) !important;
  max-width: none;
  display: block;
  background: transparent !important;
  filter: drop-shadow(0 10px 20px rgba(0, 137, 255, .10));
}

.home-user {
  min-height: 58px;
  display: flex !important;
  align-items: center;
  gap: 18px;
  color: #101827;
  font-size: 24px;
  font-weight: 800;
}

.home-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .9), transparent 17%),
    linear-gradient(145deg, #75c9ff 0%, #1c8dff 58%, #006de5 100%);
  box-shadow: 0 16px 30px rgba(0, 113, 229, .20);
}

.home-user strong {
  color: #101827;
  line-height: 1;
}

.home-admin,
.home-logout {
  min-width: 86px;
  height: 52px;
  border: 1px solid #d9e5f5;
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  color: #253247;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(20, 91, 170, .08);
}

.home-admin {
  color: #fff;
  border-color: #1688ff;
  background: linear-gradient(145deg, #38a9ff 0%, #1688ff 58%, #006fea 100%);
  box-shadow: 0 14px 30px rgba(29, 130, 239, .22);
}

.home-admin:hover {
  transform: translateY(-2px);
  border-color: #0879ed;
  background: linear-gradient(145deg, #4fb5ff 0%, #1688ff 58%, #006fea 100%);
}

.home-logout:hover {
  border-color: #b9d7ff;
  color: #0879ed;
  background: #fff;
}

.home-hero {
  height: clamp(330px, 23vw, 420px);
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  box-shadow:
    0 28px 70px rgba(21, 89, 172, .18),
    0 10px 22px rgba(15, 23, 42, .06);
  isolation: isolate;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0, 111, 255, .90) 0%, rgba(33, 147, 255, .78) 36%, rgba(255, 255, 255, .08) 70%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.home-hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  width: min(920px, 58%);
  height: 100%;
  padding: clamp(42px, 4.2vw, 68px) clamp(56px, 6vw, 96px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  color: #fff;
}

.home-hero-copy p,
.home-hero-copy h1,
.home-hero-copy strong {
  margin: 0;
  color: #fff;
  text-shadow: 0 10px 26px rgba(0, 62, 150, .18);
}

.home-hero-copy p {
  font-size: clamp(28px, 2.2vw, 44px);
  line-height: 1.1;
  font-weight: 500;
}

.home-hero-copy h1 {
  font-size: clamp(56px, 4.35vw, 82px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.home-hero-copy span {
  width: 82px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
}

.home-hero-copy strong {
  font-size: clamp(22px, 1.65vw, 30px);
  line-height: 1.45;
  font-weight: 600;
  white-space: nowrap;
}

.portal-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 28px !important;
  align-items: stretch;
}

.portal-card {
  height: clamp(328px, 18.3vw, 350px) !important;
  min-height: 0 !important;
  position: relative;
  display: grid !important;
  grid-template-rows: clamp(186px, 10.6vw, 204px) auto;
  gap: 20px;
  overflow: visible;
  padding: 18px 18px 28px !important;
  border: 1px solid rgba(210, 224, 244, .88) !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow:
    0 24px 60px rgba(32, 96, 171, .12),
    inset 0 1px 0 rgba(255, 255, 255, .9) !important;
  color: #101827;
  text-align: left;
  will-change: transform;
  transform: translateY(0) scale(1);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.portal-card::before {
  display: none !important;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-12px) scale(1.025) !important;
  border-color: rgba(0, 137, 255, .38) !important;
  background: #fff !important;
  box-shadow:
    0 38px 86px rgba(22, 109, 214, .22),
    0 14px 26px rgba(18, 62, 126, .10) !important;
  animation: portalBreath 1.45s ease-in-out infinite alternate;
  z-index: 2;
}

.portal-illustration {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #eef6ff;
}

.portal-illustration img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  display: block;
  object-fit: cover !important;
  object-position: center center;
  transition: transform .28s ease;
}

.portal-card:hover .portal-illustration img,
.portal-card:focus-visible .portal-illustration img {
  transform: scale(1.035);
}

.portal-copy {
  display: grid;
  gap: 10px;
  padding: 0 18px;
}

.portal-card strong {
  color: #101827 !important;
  font-size: clamp(26px, 1.7vw, 34px) !important;
  line-height: 1.12;
  font-weight: 900 !important;
  letter-spacing: 0;
}

.portal-card small {
  color: #70798b !important;
  font-size: clamp(15px, .95vw, 18px);
  line-height: 1.35;
  font-weight: 700 !important;
}

.portal-arrow {
  position: absolute;
  right: 28px;
  bottom: 30px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, #38a9ff 0%, #1688ff 58%, #006fea 100%);
  box-shadow: 0 14px 30px rgba(29, 130, 239, .24);
  transition: transform .22s ease, box-shadow .22s ease;
}

.portal-arrow svg {
  width: 32px;
  height: 32px;
  display: block;
  stroke: currentColor;
  stroke-width: 3.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-card:hover .portal-arrow,
.portal-card:focus-visible .portal-arrow {
  color: #fff;
  transform: translateX(4px) scale(1.06);
  box-shadow: 0 20px 36px rgba(29, 130, 239, .34);
}

@keyframes portalBreath {
  from { transform: translateY(-10px) scale(1.018); }
  to { transform: translateY(-14px) scale(1.032); }
}

.home-route-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .96) 0%, rgba(237, 247, 255, .98) 54%, rgba(224, 242, 255, .96) 100%);
  backdrop-filter: blur(10px);
  transition: opacity .22s ease;
}

.home-route-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 133, 255, .12), transparent 34%, rgba(105, 210, 255, .16)),
    radial-gradient(circle at 42% 36%, rgba(0, 137, 255, .14), transparent 30%);
  opacity: .75;
}

.home-route-loader.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.route-loader-card {
  position: relative;
  width: min(520px, calc(100vw - 56px));
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 46px 42px;
  border: 1px solid rgba(196, 222, 255, .78);
  border-radius: 34px;
  background: rgba(255, 255, 255, .78);
  box-shadow:
    0 34px 90px rgba(22, 109, 214, .18),
    inset 0 1px 0 rgba(255, 255, 255, .86);
  transform: translateY(14px) scale(.98);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

.home-route-loader.is-visible .route-loader-card {
  transform: translateY(0) scale(1);
}

.route-loader-logo {
  width: min(280px, 66vw);
  display: block;
  filter: drop-shadow(0 14px 28px rgba(0, 137, 255, .13));
  animation: routeLogoFloat 1.45s ease-in-out infinite alternate;
}

.route-loader-line {
  width: 140px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 137, 255, .12);
}

.route-loader-line::after {
  content: "";
  display: block;
  width: 54px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0089ff, #70c8ff);
  animation: routeLineMove 1.08s ease-in-out infinite;
}

.route-loader-card p {
  margin: 0;
  color: #23324a;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.route-loader-dots {
  display: inline-flex;
  width: 42px;
  justify-content: space-between;
  margin-left: 8px;
  vertical-align: middle;
}

.route-loader-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #1688ff;
  opacity: .35;
  animation: routeDotPulse .9s ease-in-out infinite;
}

.route-loader-dots i:nth-child(2) {
  animation-delay: .14s;
}

.route-loader-dots i:nth-child(3) {
  animation-delay: .28s;
}

@keyframes routeLogoFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@keyframes routeLineMove {
  0% { transform: translateX(-54px); }
  50% { transform: translateX(54px); }
  100% { transform: translateX(140px); }
}

@keyframes routeDotPulse {
  0%, 100% { opacity: .3; transform: translateY(0) scale(.86); }
  50% { opacity: 1; transform: translateY(-5px) scale(1.08); }
}

@media (max-width: 1180px) {
  .home-shell {
    width: min(100% - 40px, 980px);
    padding-top: 24px !important;
    gap: 28px !important;
  }

  .home-head {
    height: auto;
  }

  .home-hero {
    height: 330px;
    border-radius: 28px;
  }

  .home-hero-copy {
    width: min(650px, 70%);
    padding: 48px;
  }

  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .home-shell {
    width: min(100% - 28px, 430px);
    padding: 16px 0 34px !important;
    gap: 20px !important;
  }

  .home-head {
    gap: 14px;
    align-items: flex-start;
  }

  .home-head .brand-logo {
    width: 170px !important;
  }

  .home-user {
    gap: 10px;
    font-size: 16px;
  }

  .home-avatar {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .home-admin,
  .home-logout {
    min-width: 62px;
    height: 40px;
    font-size: 15px;
    border-radius: 10px;
  }

  .home-hero {
    height: 260px;
    border-radius: 24px;
  }

  .home-hero::after {
    background: linear-gradient(90deg, rgba(0, 111, 255, .88), rgba(33, 147, 255, .72));
  }

  .home-hero-art {
    opacity: .55;
  }

  .home-hero-copy {
    width: 100%;
    padding: 30px 26px;
  }

  .home-hero-copy h1,
  .home-hero-copy strong {
    white-space: normal;
  }

  .portal-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .portal-card {
    height: 320px !important;
    border-radius: 24px !important;
    grid-template-rows: 190px auto;
  }

  .route-loader-card {
    min-height: 238px;
    border-radius: 28px;
    padding: 38px 28px;
  }

  .route-loader-card p {
    font-size: 20px;
  }
}
