:root {
  color-scheme: light;
  --portal-ink: #30231c;
  --portal-soft: #75675c;
  --portal-bronze: #9a6a34;
  --portal-line: rgba(139, 101, 58, .2);
  --portal-paper: rgba(255, 253, 248, .91);
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 11% 16%, rgba(189, 154, 102, .14), transparent 29%),
    radial-gradient(circle at 88% 82%, rgba(92, 133, 109, .11), transparent 31%),
    linear-gradient(145deg, #eee7dc, #f8f4ed 48%, #e9dfd2);
}

.portal-root {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Han Sans", "Microsoft YaHei", sans-serif;
  color: var(--portal-ink);
  -webkit-font-smoothing: antialiased;
}

.portal-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.portal-shell {
  width: min(1120px, 100%);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .5), transparent 46%),
    var(--portal-paper);
  box-shadow:
    0 32px 80px rgba(66, 48, 36, .18),
    0 2px 5px rgba(66, 48, 36, .08),
    inset 0 1px 0 #fff;
  backdrop-filter: blur(24px) saturate(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.08);
  box-sizing: border-box;
  animation: portal-in .48s cubic-bezier(.2, .78, .2, 1) both;
}

.portal-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 40px;
  padding: 4px 8px 30px;
  border-bottom: 1px solid var(--portal-line);
}

.portal-head img {
  width: 220px;
  max-height: 90px;
  object-fit: contain;
  object-position: left center;
}

.portal-head span {
  display: block;
  color: var(--portal-bronze);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .25em;
}

.portal-head h1 {
  margin: 7px 0 6px;
  font-family: "Songti SC", "Han Serif", serif;
  font-size: clamp(29px, 3vw, 42px);
  line-height: 1.16;
  letter-spacing: .025em;
}

.portal-head p {
  margin: 0;
  color: var(--portal-soft);
  font-size: 16px;
  line-height: 1.7;
}

.portal-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0;
  padding: 14px 18px;
  border: 1px solid rgba(86, 132, 106, .19);
  border-radius: 16px;
  background: rgba(222, 237, 227, .48);
}

.portal-status span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #35664e;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.portal-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5f9778;
  box-shadow: 0 0 0 6px rgba(95, 151, 120, .12);
}

.portal-status p {
  margin: 0;
  color: #65756b;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.portal-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portal-role-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr 20px;
  align-items: center;
  gap: 16px;
  min-height: 166px;
  padding: 24px 20px;
  border: 1px solid var(--portal-line);
  border-radius: 24px;
  color: inherit;
  background: linear-gradient(155deg, rgba(255, 255, 255, .94), rgba(247, 242, 233, .76));
  box-shadow:
    0 12px 28px rgba(73, 52, 37, .08),
    inset 0 1px 0 #fff;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease, background .24s ease;
}

.portal-role-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 15% 8%, rgba(255, 255, 255, .75), transparent 38%);
  pointer-events: none;
}

.portal-role-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 91, 44, .48);
  box-shadow: 0 20px 42px rgba(73, 52, 37, .14), inset 0 1px 0 #fff;
}

.portal-role-card:active {
  transform: translateY(-1px) scale(.99);
}

.portal-role-card:focus-visible {
  outline: 3px solid rgba(154, 106, 52, .25);
  outline-offset: 3px;
}

.portal-role-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 20px;
  color: #fff;
  font-family: "Songti SC", "Han Serif", serif;
  font-size: 30px;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(45, 28, 16, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 9px 20px rgba(67, 47, 32, .18);
}

.portal-role-customer .portal-role-symbol {
  background: linear-gradient(145deg, #729985, #3f735c);
}

.portal-role-frontdesk .portal-role-symbol {
  background: linear-gradient(145deg, #be8254, #88512e);
}

.portal-role-admin .portal-role-symbol {
  background: linear-gradient(145deg, #81543c, #452b20);
}

.portal-role-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-width: 0;
}

.portal-role-copy small {
  color: var(--portal-bronze);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.portal-role-copy strong {
  margin-top: 6px;
  font-size: 21px;
  line-height: 1.3;
}

.portal-role-copy em {
  margin-top: 8px;
  color: var(--portal-soft);
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.portal-role-arrow {
  position: relative;
  z-index: 1;
  color: #9b8878;
  font-size: 32px;
  font-weight: 300;
  transition: transform .22s ease;
}

.portal-role-card:hover .portal-role-arrow {
  transform: translateX(3px);
}

.portal-role-card.is-loading {
  opacity: .65;
  pointer-events: none;
}

.portal-error {
  min-height: 20px;
  margin: 13px 4px 0;
  color: #ad4d45;
  font-size: 13px;
  text-align: center;
}

.portal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 6px 0;
  border-top: 1px solid var(--portal-line);
  color: #887b70;
  font-size: 12px;
}

.portal-foot b {
  color: #5f5045;
  font-weight: 600;
  white-space: nowrap;
}

@keyframes portal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .portal-shell {
    padding: 26px;
    border-radius: 28px;
  }

  .portal-head {
    grid-template-columns: 180px 1fr;
    gap: 24px;
  }

  .portal-head img {
    width: 170px;
  }

  .portal-role-grid {
    grid-template-columns: 1fr;
  }

  .portal-role-card {
    min-height: 112px;
  }
}

@media (max-width: 620px) {
  .portal-page {
    padding: 14px;
  }

  .portal-shell {
    padding: 22px 18px;
  }

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

  .portal-status,
  .portal-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-status p {
    text-align: left;
  }

  .portal-role-card {
    grid-template-columns: 56px 1fr 16px;
    padding: 18px 16px;
  }

  .portal-role-symbol {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-shell,
  .portal-role-card,
  .portal-role-arrow {
    animation: none;
    transition: none;
  }
}
