:root {
  --portal-bg: #050814;
  --portal-surface: rgba(12, 18, 40, 0.82);
  --portal-surface-soft: rgba(11, 17, 33, 0.72);
  --portal-text: #f5f8ff;
  --portal-muted: rgba(217, 226, 247, 0.74);
  --portal-muted-strong: rgba(245, 248, 255, 0.88);
  --portal-line: rgba(151, 177, 230, 0.2);
  --portal-line-strong: rgba(130, 215, 255, 0.36);
  --portal-blue: #78c7ff;
  --portal-teal: #62f0d3;
  --portal-amber: #ffc36b;
  --portal-magenta: #ff7bd5;
  --portal-green: #81f2a5;
  --portal-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--portal-text);
  background: var(--portal-bg);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body.portal-body,
body.login-body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--portal-text);
  background:
    radial-gradient(circle at 16% 0%, rgba(109, 216, 255, 0.22), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(255, 123, 213, 0.22), transparent 28%),
    radial-gradient(circle at 70% 78%, rgba(98, 240, 211, 0.12), transparent 30%),
    linear-gradient(180deg, #070b19 0%, #050814 42%, #070a13 100%),
    var(--portal-bg);
  position: relative;
}

body.portal-body::before,
body.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 38%, rgba(120, 199, 255, 0.16) 44%, rgba(255, 123, 213, 0.12) 53%, rgba(98, 240, 211, 0.1) 60%, transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: auto, 92px 92px, 92px 92px;
  opacity: 0.82;
}

body.portal-body::after,
body.login-body::after {
  content: "";
  position: fixed;
  right: -18vw;
  top: 12vh;
  width: 62vw;
  height: 58vh;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 35% 42%, rgba(120, 199, 255, 0.28), transparent 54%),
    radial-gradient(ellipse at 62% 58%, rgba(255, 123, 213, 0.22), transparent 52%),
    radial-gradient(ellipse at 52% 34%, rgba(98, 240, 211, 0.18), transparent 48%);
  opacity: 0.72;
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 20px 24px 44px;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--portal-line);
}

.portal-brand,
.portal-nav a,
.portal-cta,
.portal-guide-item,
.module-link {
  text-decoration: none;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--portal-text);
}

.portal-brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--portal-teal), var(--portal-blue));
  box-shadow:
    0 0 0 4px rgba(98, 240, 211, 0.1),
    0 0 20px rgba(120, 199, 255, 0.36);
}

.portal-brand-copy {
  display: grid;
  gap: 2px;
}

.portal-brand-copy strong,
.portal-brand-copy em {
  font-style: normal;
}

.portal-brand-copy strong {
  font-size: 16px;
  line-height: 1.2;
}

.portal-brand-copy em {
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.2;
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.portal-nav a,
.portal-top-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--portal-line);
  border-radius: 6px;
  color: var(--portal-muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.portal-nav a:hover,
.portal-nav a:focus-visible {
  color: var(--portal-text);
  border-color: var(--portal-line-strong);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.portal-top-state {
  color: var(--portal-teal);
  border-color: rgba(98, 240, 211, 0.32);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 34px;
  align-items: start;
  padding: 48px 0 38px;
  border-bottom: 1px solid var(--portal-line);
}

.eyebrow,
.section-kicker,
.portal-side-label,
.module-index {
  margin: 0;
  color: var(--portal-teal);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--portal-text);
  font-size: 48px;
  line-height: 1.12;
  font-weight: 820;
}

.portal-lead {
  margin: 18px 0 0;
  max-width: 700px;
  color: var(--portal-muted);
  font-size: 17px;
  line-height: 1.8;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.portal-cta,
.module-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 800;
  white-space: nowrap;
}

.portal-cta.primary,
.module-link {
  color: #06101f;
  background: linear-gradient(135deg, var(--portal-teal), var(--portal-blue) 58%, var(--portal-magenta));
  box-shadow: 0 14px 32px rgba(88, 188, 255, 0.22);
}

.portal-cta.secondary,
.module-link.ghost {
  color: var(--portal-text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--portal-line-strong);
}

.portal-cta:hover,
.portal-cta:focus-visible,
.module-link:hover,
.module-link:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.portal-guide-panel {
  border-left: 4px solid rgba(98, 240, 211, 0.34);
  padding-left: 22px;
}

.portal-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.portal-guide-head h2,
.portal-section-head h2,
.module-card h2 {
  margin: 0;
  color: var(--portal-text);
}

.portal-guide-head h2 {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.2;
}

.portal-guide-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 34px;
  border-radius: 6px;
  color: var(--portal-teal);
  background: rgba(98, 240, 211, 0.1);
  font-weight: 800;
}

.portal-guide-list {
  display: grid;
  gap: 8px;
}

.portal-guide-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 0 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  color: var(--portal-text);
  background: var(--portal-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.portal-guide-item:hover,
.portal-guide-item:focus-visible {
  border-color: var(--portal-line-strong);
  outline: none;
}

.portal-guide-index,
.portal-guide-item small {
  color: var(--portal-muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.portal-guide-item strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 16px;
}

.portal-section-head h2 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.2;
}

.portal-section-head p {
  max-width: 440px;
  margin: 0;
  color: var(--portal-muted);
  font-size: 15px;
  line-height: 1.7;
}

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

.module-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 38%, rgba(120, 199, 255, 0.06));
  opacity: 0.76;
}

.module-card.pending {
  background: var(--portal-surface-soft);
  box-shadow: none;
}

.module-card-top,
.module-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.module-card-top {
  align-items: flex-start;
}

.module-card-footer {
  margin-top: auto;
  align-items: flex-end;
}

.module-index {
  color: var(--portal-muted);
}

.module-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 8px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.module-status.live {
  color: var(--portal-green);
  background: rgba(129, 242, 165, 0.12);
}

.module-status.pending {
  color: var(--portal-amber);
  background: rgba(255, 195, 107, 0.12);
}

.module-aura {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 3px;
  background: var(--portal-teal);
  box-shadow: 0 0 18px rgba(98, 240, 211, 0.45);
}

.module-card.pending .module-aura {
  background: var(--portal-amber);
}

.module-copy {
  display: grid;
  gap: 10px;
}

.module-card h2 {
  font-size: 24px;
  line-height: 1.2;
}

.module-subtitle {
  margin: 0;
  color: var(--portal-blue);
  font-size: 14px;
  font-weight: 800;
}

.module-description,
.module-hint {
  margin: 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.65;
}

.module-hint {
  max-width: 58%;
}

@media (max-width: 1080px) {
  .portal-hero,
  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-hero-copy {
    grid-column: span 2;
  }

  .portal-guide-panel {
    grid-column: span 2;
  }
}

.login-body {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
}

.login-card {
  padding: 34px;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(13, 20, 45, 0.9), rgba(8, 12, 28, 0.76)),
    var(--portal-surface);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-card h1 {
  margin: 10px 0 0;
  font-size: 34px;
  line-height: 1.16;
}

.login-copy {
  margin: 12px 0 24px;
  color: var(--portal-muted);
  line-height: 1.75;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-label {
  color: var(--portal-muted-strong);
  font-size: 14px;
  font-weight: 800;
}

.login-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--portal-text);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
}

.login-input:focus {
  outline: 2px solid rgba(120, 199, 255, 0.28);
  border-color: var(--portal-line-strong);
}

.login-error {
  margin: 0;
  color: #ffb4c8;
  font-size: 14px;
  font-weight: 800;
}

.login-submit {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #06101f;
  background: linear-gradient(135deg, var(--portal-teal), var(--portal-blue) 58%, var(--portal-magenta));
  box-shadow: 0 14px 32px rgba(88, 188, 255, 0.22);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.login-submit:hover,
.login-submit:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

@media (max-width: 760px) {
  .portal-shell {
    padding: 16px 14px 32px;
  }

  .portal-topbar,
  .portal-section-head,
  .module-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-nav {
    justify-content: flex-start;
  }

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

  .portal-hero {
    padding: 30px 0 26px;
  }

  .portal-hero-copy,
  .portal-guide-panel {
    grid-column: auto;
  }

  .portal-hero h1 {
    font-size: 36px;
  }

  .portal-guide-panel {
    border-left: 0;
    border-top: 4px solid rgba(15, 118, 110, 0.28);
    padding-top: 18px;
    padding-left: 0;
  }

  .portal-guide-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .portal-guide-item small {
    grid-column: 2;
  }

  .portal-actions,
  .portal-cta,
  .module-link {
    width: 100%;
  }

  .module-card {
    min-height: 0;
  }

  .module-hint {
    max-width: none;
  }
}
