:root {
  --bg: #05070b;
  --panel: rgba(12, 18, 28, 0.9);
  --panel-strong: rgba(15, 26, 38, 0.96);
  --line: rgba(116, 232, 255, 0.2);
  --line-strong: rgba(116, 232, 255, 0.48);
  --text: #f3fbff;
  --muted: #9ab2c0;
  --cyan: #74e8ff;
  --green: #69f0ae;
  --amber: #ffd166;
  --red: #ff5d7d;
  --blue: #7aa7ff;
  --ink: #061116;
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(116, 232, 255, 0.12), transparent 34%),
    radial-gradient(circle at 16% 16%, rgba(105, 240, 174, 0.12), transparent 32%),
    radial-gradient(circle at 86% 10%, rgba(122, 167, 255, 0.14), transparent 32%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.74), transparent 96%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: rgba(116, 232, 255, 0.08);
  cursor: pointer;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(154, 178, 192, 0.28);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  padding: 0 12px;
}

.portal-shell {
  position: relative;
  z-index: 1;
  max-width: 1760px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(12, 31, 45, 0.96), rgba(7, 11, 20, 0.94));
  padding: 16px 18px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.34);
}

.brand span,
.eyebrow,
.workspace-head span,
.panel-title span,
.module-nav small {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand h1,
.hero-copy h2,
.workspace-head h2,
.stage-info h3,
.panel-title h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.2;
}

.copyright-line {
  display: block;
  margin-top: 8px;
  color: #c7dbe3;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
}

.status-strip div {
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.status-strip strong {
  display: block;
  color: var(--green);
  font-size: 22px;
}

.status-strip span {
  color: var(--muted);
  font-size: 12px;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 380px;
  gap: 16px;
  margin-top: 16px;
}

.hero-panel,
.login-card,
.sidebar,
.workspace-main,
.module-stage,
.embedded-panel,
.teacher-analytics {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), rgba(7, 12, 18, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 72px rgba(0, 0, 0, 0.28);
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(360px, 1fr);
  min-height: 560px;
  overflow: hidden;
  padding: 28px;
}

.hero-copy {
  align-self: center;
  max-width: 680px;
}

.hero-copy h2 {
  font-size: clamp(34px, 5vw, 72px);
  line-height: 1.05;
}

.hero-copy p {
  max-width: 620px;
  color: #d6e8ef;
  line-height: 1.8;
  font-size: 16px;
}

.orbital-map {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(116, 232, 255, 0.28);
  border-radius: 50%;
  transform: rotateX(62deg);
}

.orbit-a {
  width: 78%;
  height: 44%;
  animation: spin 10s linear infinite;
}

.orbit-b {
  width: 56%;
  height: 32%;
  animation: spin 7s linear reverse infinite;
}

@keyframes spin {
  to { transform: rotateX(62deg) rotateZ(360deg); }
}

.core {
  display: grid;
  place-items: center;
  width: min(220px, 60%);
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--cyan);
  background: radial-gradient(circle, rgba(116, 232, 255, 0.25), rgba(6, 17, 22, 0.86));
  box-shadow: 0 0 90px rgba(116, 232, 255, 0.23);
  text-align: center;
  font-size: 26px;
  font-weight: 800;
}

.node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 76px;
  height: 34px;
  border: 1px solid rgba(116, 232, 255, 0.45);
  border-radius: 999px;
  background: rgba(6, 17, 22, 0.86);
}

.n1 { left: 8%; top: 28%; }
.n2 { right: 12%; top: 18%; }
.n3 { left: 18%; bottom: 18%; }
.n4 { right: 8%; bottom: 28%; }

.login-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-mode-tab {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.auth-mode-tab.active {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
}

.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-tab.active,
.primary-action {
  color: var(--ink);
  background: var(--cyan);
}

.primary-action:disabled {
  opacity: 0.66;
  cursor: wait;
}

.demo-accounts {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(105, 240, 174, 0.22);
  border-radius: 7px;
  background: rgba(105, 240, 174, 0.075);
  padding: 10px 12px;
}

.demo-accounts strong {
  color: var(--green);
  font-size: 13px;
}

.demo-accounts span {
  color: #d6e8ef;
  font-size: 13px;
}

.login-card label {
  display: grid;
  gap: 7px;
}

.login-card label span,
.login-hint {
  color: var(--muted);
  font-size: 13px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message.error {
  color: #ffd7de;
}

.auth-message.info {
  color: var(--cyan);
}

.platform-view,
.workspace-view {
  margin-top: 16px;
}

.workspace-view {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.hidden {
  display: none !important;
}

.sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  padding: 14px;
}

.profile {
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.profile-strip {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.route-note {
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.route-note strong,
.route-note span {
  display: block;
}

.route-note span {
  margin-top: 6px;
  color: var(--muted);
}

.platform-head,
.platform-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), rgba(7, 12, 18, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 72px rgba(0, 0, 0, 0.24);
  padding: 14px;
}

.platform-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.platform-card {
  display: grid;
  align-content: space-between;
  min-height: 300px;
  gap: 12px;
}

.platform-card.live {
  border-color: rgba(105, 240, 174, 0.45);
  background:
    radial-gradient(circle at 20% 0%, rgba(105, 240, 174, 0.14), transparent 40%),
    linear-gradient(180deg, var(--panel), rgba(7, 12, 18, 0.9));
}

.platform-card.planned {
  border-style: dashed;
  opacity: 0.82;
}

.platform-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.platform-card-head span {
  color: var(--cyan);
  font-size: 12px;
}

.platform-card-head strong {
  border: 1px solid rgba(154, 178, 192, 0.2);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--green);
  font-size: 12px;
}

.platform-card.planned .platform-card-head strong {
  color: var(--amber);
}

.platform-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.28;
}

.platform-card p,
.platform-card-meta {
  color: #d6e8ef;
  line-height: 1.65;
}

.platform-card-meta small {
  color: var(--muted);
}

.platform-card button {
  width: 100%;
}

.platform-card.live button {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
}

.planned-button {
  color: var(--muted);
  border-color: rgba(154, 178, 192, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.profile span,
.profile small {
  display: block;
  color: var(--muted);
}

.profile strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
}

.module-nav {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.module-button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 76px;
  text-align: left;
  padding: 10px;
}

.module-button.active {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
}

.module-button.active small {
  color: #123425;
}

.ghost-action {
  width: 100%;
}

.back-action {
  margin-top: 12px;
}

.workspace-main {
  min-width: 0;
  padding: 14px;
}

.platform-banner {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid rgba(105, 240, 174, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(105, 240, 174, 0.12), transparent),
    rgba(255, 255, 255, 0.035);
  padding: 13px 14px;
}

.platform-banner span {
  color: var(--green);
  font-size: 12px;
}

.platform-banner strong {
  font-size: 20px;
  line-height: 1.35;
}

.platform-banner small {
  color: var(--muted);
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.workspace-head h2 {
  font-size: 28px;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-card,
.meta-card,
.insight-card {
  min-width: 0;
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.summary-card span,
.meta-card span {
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong,
.meta-card strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-card strong {
  font-size: 14px;
  line-height: 1.45;
}

.module-stage {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}

.stage-info p {
  color: #d6e8ef;
  line-height: 1.7;
}

.module-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.teacher-analytics,
.embedded-panel {
  margin-top: 14px;
  padding: 14px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr) minmax(220px, 0.7fr);
  gap: 12px;
}

.analytics-grid canvas {
  width: 100%;
  height: 230px;
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.teacher-insights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.insight-card strong,
.insight-card p,
.module-button strong,
.module-button span,
.stage-info p {
  overflow-wrap: anywhere;
}

iframe {
  display: block;
  width: 100%;
  height: 680px;
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: 7px;
  background: #fff;
}

.portal-footer {
  margin-top: 14px;
  border: 1px solid rgba(154, 178, 192, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 12px 14px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .login-view,
  .hero-panel,
  .profile-strip,
  .workspace-view,
  .module-stage,
  .analytics-grid,
  .platform-cards {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

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

  .topbar,
  .workspace-head,
  .panel-title {
    display: grid;
  }

  .status-strip,
  .summary-cards,
  .module-meta,
  .teacher-insights {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
    padding: 16px;
  }

  .hero-copy h2 {
    font-size: 34px;
  }

  .orbital-map {
    min-height: 300px;
  }

  .workspace-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  iframe {
    height: 560px;
  }
}
