:root {
  --bg: #0d0617;
  --text: #f6f1ff;
  --muted: rgba(238, 230, 250, .72);
  --line: rgba(255, 255, 255, .11);
  --card: rgba(28, 16, 46, .56);
  --violet: #a976ff;
  --blue: #708cff;
  --pink: #ed71d1;
  --cyan: #55d9e8;
  --gold: #efb86b;
  --green: #68d6a1;
  --indigo: #8c78ff;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background-color: #0e051a;
  background-image: url("introBg.jpg");
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  letter-spacing: .02em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

#space {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.aurora {
  position: fixed;
  z-index: -1;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: .18;
  animation: breathe 8s ease-in-out infinite alternate;
}

.aurora--one { top: -16rem; left: 28%; background: #b44dff; }
.aurora--two { right: -18rem; bottom: -18rem; background: #3d62ff; animation-delay: -4s; }

.site-header {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 34px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 143px;
  height: 38px;
  object-fit: contain;
}

.logout-link {
  padding: 9px 2px;
  color: rgba(246, 241, 255, .68);
  font-size: 12px;
  letter-spacing: .14em;
  text-decoration: none;
  transition: color .2s;
}

.logout-link:hover { color: #fff; }
.logout-link:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }

main {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 68px 0 34px;
}

.hero {
  position: relative;
  max-width: 760px;
  margin-bottom: 38px;
}

.hero__outline {
  display: none;
  width: min(760px, 100%);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 5px rgba(161, 78, 255, .12));
}

.hero__glyph,
.hero__thread {
  fill: none;
  stroke: #b36dff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: var(--offset);
  opacity: 0;
  animation: glyph-trace var(--duration) cubic-bezier(.18,.74,.22,1) var(--delay) forwards;
}

.hero__glyph { stroke-width: 1.15; }
.hero__thread { stroke-width: .82; stroke: #9559ef; }

.hero h1 {
  margin: 0;
  color: rgba(251, 248, 255, .95);
  font-size: clamp(30px, 4.2vw, 52px);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: .14em;
  opacity: 0;
  transform: translateY(18px);
  text-shadow: 0 0 24px rgba(151, 75, 255, .2);
  animation: hero-subtitle-in 1.25s cubic-bezier(.16,.72,.2,1) 1.18s forwards;
}

.portal-directory { width: 100%; }

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.system-group {
  --accent: var(--violet);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.018)), var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  opacity: 0;
  translate: 0 34px;
  filter: blur(4px);
  animation: portal-group-in .85s cubic-bezier(.16,.72,.2,1) var(--group-delay) forwards;
}

.system-group__header {
  min-height: 66px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.system-group__number {
  color: rgba(255, 255, 255, .34);
  font: 10px/1 Arial, sans-serif;
  letter-spacing: .16em;
}

.system-group__header h3 {
  margin: 0;
  color: rgba(251, 248, 255, .92);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .12em;
}

.system-group__links {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.system-link {
  --accent: var(--violet);
  position: relative;
  min-height: 104px;
  padding: 18px 18px 18px 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 17px;
  color: var(--text);
  text-decoration: none;
  background: rgba(12, 6, 23, .25);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s, background .35s, box-shadow .35s;
  transform-style: preserve-3d;
}

.system-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: scaleY(.4);
  transition: opacity .35s, transform .35s;
}

.system-link::after {
  content: "";
  position: absolute;
  top: -5rem;
  right: -5rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(62px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}

.system-link:hover,
.system-link:focus-visible {
  z-index: 2;
  outline: none;
  transform: translateY(-5px) perspective(900px) rotateX(1.2deg);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.022)), rgba(31, 17, 50, .78);
  box-shadow: 0 22px 56px rgba(0, 0, 0, .3), 0 0 32px color-mix(in srgb, var(--accent) 12%, transparent);
}

.system-link:hover::before,
.system-link:focus-visible::before { opacity: 1; transform: scaleY(1); }

.system-link:hover::after,
.system-link:focus-visible::after { opacity: .12; }

.system-link__icon {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  transform: rotate(45deg);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}

.system-link:hover .system-link__icon,
.system-link:focus-visible .system-link__icon {
  transform: rotate(0deg);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.system-link__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-45deg);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}

.system-link:hover .system-link__icon svg,
.system-link:focus-visible .system-link__icon svg { transform: rotate(0deg); }

.system-link__content {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.system-link__tag {
  margin-bottom: 6px;
  overflow: hidden;
  color: var(--accent);
  font: 700 9px/1.2 Arial, sans-serif;
  letter-spacing: .2em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-link__content strong {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .08em;
}

.system-link__arrow {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: rgba(255, 255, 255, .48);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s, stroke .3s;
}

.system-link:hover .system-link__arrow,
.system-link:focus-visible .system-link__arrow {
  stroke: var(--accent);
  transform: translateX(3px);
}

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

.portal-card {
  --accent: var(--violet);
  position: relative;
  min-height: 258px;
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018)), var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s, background .35s, box-shadow .35s;
  transform-style: preserve-3d;
  opacity: 0;
  translate: 0 42px;
  filter: blur(4px);
  animation: portal-card-in .9s cubic-bezier(.16,.72,.2,1) forwards;
}

.portal-card:nth-child(1) { animation-delay: 2.12s; }
.portal-card:nth-child(2) { animation-delay: 2.27s; }
.portal-card:nth-child(3) { animation-delay: 2.42s; }
.portal-card:nth-child(4) { animation-delay: 2.57s; }
.portal-card:nth-child(5) { animation-delay: 2.72s; }
.portal-card:nth-child(6) { animation-delay: 2.87s; }
.portal-card:nth-child(7) { animation-delay: 3.02s; grid-column: 2; }

.portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: scaleX(.45);
  transition: opacity .35s, transform .35s;
}

.portal-card::after {
  content: "";
  position: absolute;
  top: -6rem;
  right: -7rem;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(72px);
  opacity: 0;
  transition: opacity .4s;
}

.portal-card:hover,
.portal-card:focus-visible {
  z-index: 2;
  outline: none;
  transform: translateY(-8px) perspective(900px) rotateX(1.2deg);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.025)), rgba(31, 17, 50, .78);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .32), 0 0 36px color-mix(in srgb, var(--accent) 12%, transparent);
}

.portal-card:hover::before,
.portal-card:focus-visible::before { opacity: 1; transform: scaleX(1); }
.portal-card:hover::after,
.portal-card:focus-visible::after { opacity: .12; }

.portal-card--blue { --accent: var(--blue); }
.portal-card--pink { --accent: var(--pink); }
.portal-card--cyan { --accent: var(--cyan); }
.portal-card--gold { --accent: var(--gold); }
.portal-card--green { --accent: var(--green); }
.portal-card--indigo { --accent: var(--indigo); }

.portal-card__index {
  position: absolute;
  top: 22px;
  right: 22px;
  color: rgba(255, 255, 255, .25);
  font: 10px/1 Arial, sans-serif;
  letter-spacing: .18em;
}

.portal-card__icon {
  width: 54px;
  height: 54px;
  margin-bottom: 34px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  transform: rotate(45deg);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}

.portal-card:hover .portal-card__icon { transform: rotate(0deg); box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 18%, transparent); }

.portal-card__icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-45deg);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}

.portal-card:hover .portal-card__icon svg { transform: rotate(0deg); }

.portal-card__content { display: flex; flex-direction: column; }

.portal-card__tag {
  margin-bottom: 7px;
  color: var(--accent);
  font: 700 10px/1.2 Arial, sans-serif;
  letter-spacing: .24em;
}

.portal-card__content strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: .08em;
}

.portal-card__description {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.portal-card__footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255, 255, 255, .58);
  border-top: 1px solid var(--line);
  font: 10.5px/1.35 Arial, sans-serif;
  letter-spacing: .06em;
}

.portal-card__action {
  color: rgba(255, 255, 255, .7);
  white-space: nowrap;
  transition: color .25s;
}

.portal-card__action i { margin-left: 4px; color: var(--accent); font-style: normal; }
.portal-card:hover .portal-card__action { color: #fff; }

.network-only { display: inline-flex; align-items: center; gap: 5px; }
.network-only i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }

.site-footer {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 24px 0 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, .46);
  font: 10px/1 Arial, sans-serif;
  letter-spacing: .16em;
  opacity: 0;
  animation: footer-in .9s ease-out 3s forwards;
}

.site-footer__line { width: 28px; height: 1px; background: rgba(255, 255, 255, .16); }

@keyframes breathe { to { opacity: .3; transform: scale(1.12); } }
@keyframes glyph-trace {
  0% { stroke-dashoffset: var(--offset); opacity: 0; }
  8% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes hero-subtitle-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes portal-card-in {
  from { opacity: 0; translate: 0 42px; filter: blur(4px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}
@keyframes portal-group-in {
  from { opacity: 0; translate: 0 34px; filter: blur(4px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}
@keyframes footer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 980px) {
  .directory-grid { grid-template-columns: 1fr; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-card { min-height: 240px; }
  .portal-card:nth-child(7) { grid-column: auto; }
}

@media (max-width: 620px) {
  .site-header, main, .site-footer { width: min(100% - 36px, 1180px); }
  .site-header { padding-top: 24px; }
  main { padding-top: 48px; }
  .hero { margin-bottom: 28px; }
  .hero h1 { font-size: 30px; line-height: 1.2; }
  .directory-grid { gap: 14px; }
  .system-group__header { min-height: 58px; padding: 0 18px; }
  .system-group__links { padding: 8px; gap: 6px; }
  .system-link {
    min-height: 82px;
    padding: 14px 14px 14px 16px;
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 14px;
  }
  .system-link__icon { width: 38px; height: 38px; }
  .system-link__icon svg { width: 21px; height: 21px; }
  .system-link__content strong { font-size: 17px; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-card {
    min-height: 184px;
    padding: 20px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: 1fr;
    column-gap: 18px;
    row-gap: 0;
    justify-content: initial;
  }
  .portal-card__icon {
    width: 46px;
    height: 46px;
    margin: 3px 0 0;
    grid-column: 1;
    grid-row: 1;
  }
  .portal-card__icon svg { width: 25px; height: 25px; }
  .portal-card__content {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .portal-card__content strong { font-size: 22px; }
  .portal-card__description { margin-top: 7px; line-height: 1.55; }
  .portal-card__footer {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
    padding-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .portal-card { transition: border-color .2s; }
  .portal-card:hover { transform: none; }
  .system-link { transition: border-color .2s; }
  .system-link:hover { transform: none; }
}

@supports not (color: color-mix(in srgb, white, black)) {
  .portal-card:hover { border-color: rgba(183, 130, 255, .55); }
  .portal-card__icon { border-color: rgba(183, 130, 255, .38); background: rgba(183, 130, 255, .07); }
  .system-link:hover { border-color: rgba(183, 130, 255, .55); }
  .system-link__icon { border-color: rgba(183, 130, 255, .38); background: rgba(183, 130, 255, .07); }
}
