:root {
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ec;
  --surface: #ffffff;
  --canvas: #f3f5f8;
  --primary: #2457c5;
  --primary-soft: #eaf0ff;
  --teal: #0f8f82;
  --teal-soft: #e7f7f4;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(36, 87, 197, 0.24);
  outline-offset: 2px;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--primary);
  font-size: 12px;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: var(--primary);
}

.site-logo svg {
  width: 21px;
  height: 21px;
}

.site-brand > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-brand strong {
  font-size: 15px;
}

.site-brand > div > span {
  color: var(--muted);
  font-size: 9px;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
}

.role-switch button {
  display: grid;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  min-height: 43px;
  padding: 5px 13px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.role-switch button:hover {
  color: var(--ink);
}

.role-switch button.is-active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.08);
}

.role-switch button[data-role="teacher"].is-active {
  color: var(--teal);
  background: var(--teal-soft);
}

.role-switch svg {
  width: 19px;
  height: 19px;
  margin: auto;
}

.role-switch button > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role-switch strong {
  font-size: 11px;
}

.role-switch small {
  color: inherit;
  font-size: 8px;
  opacity: 0.72;
}

.site-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1b8d52;
  box-shadow: 0 0 0 4px rgba(27, 141, 82, 0.1);
}

.site-stage {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  background: var(--canvas);
}

#prototype-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #dbe0e8;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 28px rgba(23, 32, 51, 0.06);
}

@media (max-width: 760px) {
  .site-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 9px;
    padding: 10px 12px;
  }

  .site-brand {
    width: 100%;
    justify-content: center;
  }

  .role-switch {
    width: 100%;
  }

  .role-switch button {
    min-width: 0;
    justify-content: center;
  }

  .site-meta {
    display: none;
  }

  .site-stage {
    padding: 6px;
  }

  #prototype-frame {
    border-radius: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
