.bs-avatar {
  width: 2.1rem;
  height: 2.1rem;
  image-rendering: pixelated;
  border-radius: 2px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
}


body.portal-home {
  --portal-red: #8c0000;
  --portal-red-dark: #680000;
  --portal-red-deep: #700005;
  --portal-red-bright: #b40605;
  --portal-text: #333;
  --portal-muted: #666;
  --portal-border: #dedede;
  --portal-surface: #f6f6f6;
  --portal-radius: 2px;
  --portal-ease: 0.18s ease;
  margin: 0;
  background: #fff;
  color: var(--portal-text);
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.portal-home a {
  color: var(--portal-red);
  transition: color var(--portal-ease), background-color var(--portal-ease),
    border-color var(--portal-ease);
}
.portal-home a:hover {
  color: var(--portal-red-dark);
}
.portal-home a:focus-visible,
.portal-home summary:focus-visible,
.portal-home button:focus-visible,
.portal-home input[type='checkbox']:focus-visible {
  outline: 2px solid var(--portal-red);
  outline-offset: 3px;
}
.portal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.portal-container {
  width: 100%;
  max-width: 1032px;
  margin: 0 auto;
  padding: 0 16px;
}
.portal-home a.portal-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1100;
  padding: 8px 16px;
  background: var(--portal-red);
  color: #fff;
}
.portal-home a.portal-skip-link:hover,
.portal-home a.portal-skip-link:focus {
  color: #fff;
}
.portal-home a.portal-skip-link:focus {
  top: 8px;
  outline-color: #fff;
}

/* Utility bar */
.portal-utility {
  position: relative;
  z-index: 10;
  background: var(--portal-red-deep);
  color: #ece9e9;
  font-size: 12px;
}
.portal-utility-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 32px;
}
.portal-tools {
  flex-shrink: 0;
  align-items: center;
  margin: 0 -10px 0 0;
}
.portal-home .portal-tools .nav-link {
  padding: 5px 10px;
  color: #ece9e9;
}
.portal-home .portal-tools .nav-link:hover,
.portal-home .portal-tools .nav-link:focus {
  color: #fff;
}
.portal-home .portal-tools .nav-link:focus-visible {
  outline-color: #fff;
}
.portal-tools .bs-avatar {
  width: 22px;
  height: 22px;
}
.portal-tools .dropdown-menu {
  max-width: calc(100vw - 32px);
  border-radius: var(--portal-radius);
  font-size: 13px;
}

/* Masthead */
.portal-masthead {
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, var(--portal-red) 55%, #9a0a0a);
  color: #fff;
}
.portal-header-watermark {
  position: absolute;
  top: -44px;
  right: 6%;
  color: rgba(255, 255, 255, 0.06);
  font-size: 190px;
  pointer-events: none;
}
.portal-brand {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100px;
  padding-left: 31px;
}
.portal-site-name {
  min-width: 0;
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.portal-site-name > a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 15px;
}
.portal-emblem {
  display: flex;
  flex: 0 0 60px;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 30px;
}
.portal-home .portal-site-name a,
.portal-home .portal-site-name a:hover {
  color: #fff;
  text-decoration: none;
}
.portal-home .portal-masthead a:focus-visible {
  outline-color: #fff;
}

/* Main navigation */
.portal-navigation {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--portal-border);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.portal-navigation ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.portal-navigation li {
  flex: 1 1 125px;
}
.portal-home .portal-navigation a {
  display: block;
  padding: 0 10px;
  border-bottom: 3px solid transparent;
  color: #444;
  font-size: 16px;
  line-height: 44px;
  text-align: center;
  text-decoration: none;
}
.portal-home .portal-navigation a:hover,
.portal-home .portal-navigation a:focus-visible {
  border-bottom-color: var(--portal-red-deep);
  background: var(--portal-red);
  color: #fff;
}
.portal-home .portal-navigation a:focus-visible {
  outline-color: var(--portal-red-dark);
  outline-offset: -2px;
}

/* Hero */
.portal-hero {
  position: relative;
  isolation: isolate;
  max-width: 1380px;
  margin: 0 auto;
  background: #d9e0d5;
}
.portal-hero-image {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-position: center top;
  background-size: cover;
}
.portal-hero-image::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 45%);
  content: '';
}
.portal-hero-image.is-fixed {
  background-attachment: fixed;
}
.portal-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  grid-template-areas: 'description account';
  gap: 24px;
  max-width: 1380px;
  min-height: clamp(300px, 33.333vw, 460px);
  padding: 0 clamp(20px, 4.5vw, 60px) 0 clamp(20px, 7vw, 100px);
}
.portal-hero-description {
  grid-area: description;
  align-self: end;
  justify-self: start;
  max-width: 640px;
  margin-bottom: 30px;
  padding: 10px 20px;
  border-left: 4px solid var(--portal-red-bright);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}
.portal-hero-description p {
  margin: 0;
  font-size: 22px;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  overflow-wrap: anywhere;
}

/* Login card */
.portal-account {
  grid-area: account;
  align-self: start;
  min-width: 0;
  margin-bottom: 24px;
  padding: 18px 18px 16px;
  border-top: 3px solid var(--portal-red);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
@supports (
  (-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
  .portal-account {
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}
.portal-home .portal-primary-button {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 5px;
  border: 1px solid var(--portal-red-bright);
  border-radius: var(--portal-radius);
  background: var(--portal-red-bright);
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.1em;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--portal-ease),
    border-color var(--portal-ease);
}
.portal-home .portal-primary-button:hover {
  border-color: var(--portal-red-dark);
  background: var(--portal-red-dark);
}
.portal-home .portal-primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.portal-login-row {
  position: relative;
  margin-bottom: 14px;
}
.portal-login-row > input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 5px 10px;
  border: 1px solid #c4c4c4;
  border-radius: var(--portal-radius);
  background: #fff;
  color: var(--portal-text);
  font-size: 16px;
  line-height: 28px;
  transition: border-color var(--portal-ease), box-shadow var(--portal-ease);
}
.portal-login-row > input::placeholder {
  color: #767676;
  font-size: 14px;
}
.portal-login-row > input:focus {
  border-color: var(--portal-red-bright);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(180, 6, 5, 0.15);
}
.portal-password-row > input {
  padding-right: 90px;
}
.portal-home .portal-password-help {
  position: absolute;
  top: 0;
  right: 10px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 42px;
}
.portal-login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 12px;
  font-size: 13px;
}
.portal-home .portal-login-meta a,
.portal-login-meta label {
  padding: 4px 0;
  color: #444;
}
.portal-home .portal-login-meta a:hover,
.portal-home .portal-password-help:hover {
  color: var(--portal-red);
}
.portal-login-meta label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}
.portal-login-meta input {
  margin: 0;
  accent-color: var(--portal-red-bright);
}
.portal-login-error {
  margin: 0 0 12px;
  padding: 6px 10px;
  border-left: 3px solid #b42020;
  background: #fdf1f1;
  color: #9b2020;
  font-size: 13px;
  line-height: 1.5;
}
.portal-login-error[hidden] {
  display: none;
}

/* Content */
.portal-content {
  padding-top: 32px;
  padding-bottom: 32px;
}
.portal-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 42px;
}
.portal-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
  background: linear-gradient(var(--portal-red), var(--portal-red)) left bottom /
    48px 2px no-repeat;
}
.portal-section-heading h2 {
  margin: 0;
  color: var(--portal-red);
  font-size: 19px;
  font-weight: 500;
}
.portal-home .portal-section-heading > a {
  flex-shrink: 0;
  color: var(--portal-muted);
  font-size: 13px;
}
.portal-home .portal-section-heading > a:hover {
  color: var(--portal-red);
}
.portal-announcement-content {
  padding-top: 16px;
  overflow-wrap: anywhere;
}
.portal-announcement-content > :last-child {
  margin-bottom: 0;
}
.portal-announcement-content img,
.portal-announcement-content video,
.portal-announcement-content iframe {
  max-width: 100%;
  height: auto;
}
.portal-announcement-content pre,
.portal-announcement-content table {
  max-width: 100%;
  overflow-x: auto;
}
.portal-announcement-content table {
  display: block;
}
.portal-announcement-content h1,
.portal-announcement-content h2,
.portal-announcement-content h3 {
  font-size: 18px;
}
.portal-announcement-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 120px;
  margin-top: 16px;
  padding: 20px;
  border: 1px dashed var(--portal-border);
  background: #fafafa;
  color: var(--portal-muted);
}
.portal-announcement-empty > i {
  color: #a5a5a5;
  font-size: 22px;
}
.portal-announcement-empty p {
  margin: 0;
}
.portal-announcement-empty > a {
  font-size: 13px;
}

/* Guide */
.portal-guide {
  scroll-margin-top: 20px;
}
.portal-guide details {
  border-bottom: 1px dotted #ccc;
}
.portal-guide summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  color: #444;
  list-style: none;
  cursor: pointer;
  transition: color var(--portal-ease);
}
.portal-guide summary::-webkit-details-marker {
  display: none;
}
.portal-guide summary::after {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: '';
  opacity: 0.6;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--portal-ease);
}
.portal-guide summary:hover,
.portal-guide details[open] > summary {
  color: var(--portal-red);
}
.portal-guide details[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.portal-guide details p {
  margin: 0;
  padding: 0 0 14px;
  color: var(--portal-muted);
  font-size: 13px;
}
.portal-guide details a {
  display: inline-block;
}
.portal-join-steps {
  margin: 0;
  padding: 0 0 0 22px;
  color: var(--portal-muted);
  font-size: 13px;
}
.portal-join-steps li {
  margin-bottom: 12px;
}
.portal-join-steps li::marker {
  color: var(--portal-red);
  font-weight: 600;
}
.portal-copy-field {
  display: flex;
  align-items: stretch;
  margin-top: 8px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
}
.portal-auth-address,
.portal-server-address {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 9px;
  background: transparent;
  color: #444;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: all;
}
.portal-copy-button {
  flex-shrink: 0;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--portal-border);
  background: #fff;
  color: var(--portal-red);
  font-size: 12px;
  cursor: pointer;
  transition: background-color var(--portal-ease);
}
.portal-copy-button[hidden] {
  display: none;
}
.portal-copy-button:hover {
  background: #fbeeee;
}

/* Footer */
.portal-footer {
  margin-top: auto;
  padding: 20px 0;
  border-top: 1px solid var(--portal-border);
  background: #f4f4f4;
  color: var(--portal-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.portal-footer > .portal-container::after {
  display: block;
  clear: both;
  content: '';
}

@media (max-width: 767px) {
  .portal-container {
    padding-right: 20px;
    padding-left: 20px;
  }
  .portal-brand {
    min-height: 80px;
  }
  .portal-site-name {
    font-size: 24px;
  }
  .portal-emblem {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  .portal-home .portal-navigation a {
    padding-right: 8px;
    padding-left: 8px;
  }
  .portal-hero-inner {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 16px;
    padding: 0 20px;
  }
  .portal-hero-description p {
    font-size: 18px;
  }
  .portal-columns {
    gap: 28px;
  }
}

@media (max-width: 575px) {
  .portal-tools .nav-link {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .portal-brand {
    min-height: 70px;
    padding: 0 16px;
  }
  .portal-site-name {
    font-size: 18px;
  }
  .portal-site-name > a {
    gap: 0 10px;
  }
  .portal-emblem {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .portal-header-watermark {
    top: -26px;
    right: 10px;
    font-size: 130px;
  }
  .portal-navigation li {
    flex: 1 1 0;
    min-width: 0;
  }
  .portal-home .portal-navigation a {
    padding: 10px 3px 7px;
    font-size: 13px;
    line-height: 22px;
  }
  .portal-hero {
    background: #fff;
  }
  .portal-hero-image {
    bottom: auto;
    height: 180px;
  }
  .portal-hero-image.is-fixed {
    background-attachment: scroll;
  }
  .portal-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'description' 'account';
    gap: 0;
    min-height: 0;
    padding: 110px 0 0;
  }
  .portal-hero-description {
    justify-self: stretch;
    max-width: none;
    margin: 0 15px;
    padding: 8px 12px;
  }
  .portal-hero-description p {
    font-size: 14px;
  }
  .portal-account {
    margin: 0;
    padding: 20px;
    border-top: 0;
    border-bottom: 1px solid var(--portal-border);
    background: #fff;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .portal-hero-inner > .portal-account:first-child {
    margin-top: 70px;
  }
  .portal-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .portal-announcement-empty {
    min-height: 95px;
  }
  .portal-section-heading h2 {
    font-size: 18px;
  }
  .portal-guide summary {
    padding: 13px 0;
  }
  .portal-footer #copyright-text {
    float: none !important;
    margin-bottom: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-home *,
  .portal-home *::before,
  .portal-home *::after {
    transition: none !important;
  }
  .portal-hero-image.is-fixed {
    background-attachment: scroll;
  }
}
