:root {
  --ink: #10243a;
  --muted: #617286;
  --school-blue: #123f70;
  --school-blue-2: #1f5d95;
  --school-plum: #8a4867;
  --school-red: #d84b4f;
  --school-gold: #e7b24a;
  --paper: #f4f7fa;
  --white: #ffffff;
  --line: #dbe4ec;
  --shadow: 0 20px 60px rgba(10, 35, 58, 0.16);
  --shadow-soft: 0 10px 32px rgba(10, 35, 58, 0.1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #0c2b4a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  color: var(--ink);
  background: #0c2b4a;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  color: white;
  background: var(--school-blue);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.school-background,
.background-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.school-background {
  z-index: 0;
  top: 76px;
  overflow: hidden;
  background: linear-gradient(90deg, #6f8fa5 0%, #d8e5ec 22%, #d8e5ec 78%, #6f8fa5 100%);
}

.school-background picture,
.school-background img {
  width: 100%;
  height: 100%;
  display: block;
}

.school-background img {
  object-fit: contain;
  object-position: center center;
  transform: none;
}

.background-wash {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 31, 55, 0.48) 0%, rgba(7, 31, 55, 0.18) 52%, rgba(7, 31, 55, 0.06) 100%),
    linear-gradient(0deg, rgba(7, 31, 55, 0.5) 0%, rgba(7, 31, 55, 0.02) 58%, rgba(7, 31, 55, 0.12) 100%);
}

body.route-inner .school-background img {
  transform: none;
}

body.route-inner .background-wash {
  background: linear-gradient(180deg, rgba(8, 31, 52, 0.22) 0, rgba(8, 31, 52, 0.42) 390px, rgba(8, 31, 52, 0.08) 560px);
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  min-height: 76px;
  padding: 10px clamp(18px, 3vw, 52px);
  display: flex;
  align-items: center;
  gap: 24px;
  color: white;
  background: rgba(7, 31, 55, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 0;
  color: white;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.school-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -1px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

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

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.nav-link,
.icon-button {
  min-height: 38px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  color: var(--ink);
  background: white;
}

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

.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: white;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.view {
  min-height: 100vh;
}

.home-view {
  color: white;
}

.hero-shell {
  min-height: 100vh;
  padding: 150px clamp(24px, 6vw, 110px) 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  align-items: center;
  gap: clamp(48px, 8vw, 140px);
}

.home-route-dock {
  position: relative;
  z-index: 3;
  padding: 24px clamp(24px, 5vw, 92px) 30px;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  background: linear-gradient(180deg, rgba(6, 27, 47, 0.97), #08243e);
  box-shadow: 0 -20px 48px rgba(4, 22, 38, 0.22);
}

.home-route-button {
  min-height: 78px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.home-route-button span {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: #d8ecfb;
  background: rgba(91, 164, 218, 0.2);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.home-route-button strong {
  font-size: 16px;
}

.home-route-button:hover,
.home-route-button:focus-visible {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.38);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: #d9e9f8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-copy h1,
.inner-hero h1 {
  margin: 0;
  letter-spacing: 0.04em;
}

.hero-copy h1 {
  max-width: 820px;
  font-size: clamp(48px, 6.5vw, 92px);
  line-height: 1.06;
  text-shadow: 0 5px 20px rgba(0, 0, 0, 0.48);
}

.hero-lead {
  max-width: 720px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(17px, 1.65vw, 23px);
  line-height: 1.8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.hero-actions,
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--school-red), #b8374d);
  box-shadow: 0 12px 28px rgba(183, 49, 69, 0.28);
}

.secondary-button {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.primary-button:hover,
.secondary-button:hover,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(10, 35, 58, 0.22);
}

.hero-side {
  position: relative;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
  background: rgba(11, 42, 70, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-side::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 0;
  width: 64px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--school-red);
}

.hero-side-label {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.total-number {
  display: block;
  font-size: clamp(54px, 6vw, 78px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-side > span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.hero-mini-stats {
  margin-top: 30px;
  padding-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-mini-stats div {
  display: grid;
  gap: 5px;
}

.hero-mini-stats strong {
  font-size: 21px;
}

.hero-mini-stats span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.home-content {
  padding: 76px clamp(24px, 5vw, 92px) 88px;
  background: linear-gradient(180deg, rgba(7, 31, 55, 0.84), #08243e 18%, #0b3153 100%);
}

.section-block {
  max-width: 1500px;
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 26px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
}

.light-heading h2 {
  color: white;
}

.text-button {
  min-height: auto;
  padding: 8px 0;
  background: none;
  border-radius: 0;
}

.light-text-button {
  color: rgba(255, 255, 255, 0.78);
}

.text-button span {
  display: inline-block;
  margin-left: 6px;
  transition: transform 180ms ease;
}

.text-button:hover span {
  transform: translateX(4px);
}

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

.value-card {
  min-height: 156px;
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 18px;
  color: white;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: 200ms ease;
}

.value-card:hover,
.value-card:focus-visible {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
}

.value-index {
  align-self: start;
  color: #8fc7f5;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.value-copy {
  display: grid;
  gap: 8px;
}

.value-copy strong {
  font-size: 19px;
}

.value-copy small {
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.6;
}

.value-arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--school-blue);
  background: white;
}

.featured-block {
  margin-top: 72px;
}

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

.featured-card {
  position: relative;
  min-height: 230px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  color: white;
  text-align: left;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.055));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: 200ms ease;
}

.featured-card::after {
  content: attr(data-mark);
  position: absolute;
  right: -10px;
  bottom: -34px;
  color: rgba(255, 255, 255, 0.055);
  font-size: 150px;
  font-weight: 900;
  line-height: 1;
}

.featured-card:hover,
.featured-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.35);
}

.featured-card .resource-badge {
  margin-bottom: auto;
}

.featured-card h3 {
  position: relative;
  z-index: 1;
  margin: 38px 0 8px;
  max-width: 92%;
  font-size: 18px;
  line-height: 1.55;
}

.featured-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.gateway-banner {
  max-width: 1500px;
  margin: 72px auto 0;
  padding: 34px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: var(--ink);
  background: linear-gradient(120deg, #ffffff, #e9f2fa);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.gateway-banner h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2.5vw, 36px);
}

.gateway-banner p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
}

.gateway-banner .section-kicker,
.portal-card .section-kicker,
.aside-card .section-kicker {
  color: var(--school-plum);
}

.gateway-actions {
  display: flex;
  gap: 10px;
}

.gateway-pill {
  min-width: 92px;
  padding: 13px 18px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.gateway-pill.student { box-shadow: inset 0 -3px #2c78bc; }
.gateway-pill.teacher { box-shadow: inset 0 -3px #7b5bb3; }
.gateway-pill.admin { box-shadow: inset 0 -3px #d8893b; }

.inner-view {
  padding: 132px clamp(24px, 5vw, 80px) 80px;
  background: linear-gradient(180deg, rgba(8, 31, 52, 0.04) 0, rgba(8, 31, 52, 0.12) 330px, rgba(244, 247, 250, 0.98) 410px, rgba(244, 247, 250, 0.98) 100%);
}

.inner-hero {
  max-width: 1500px;
  margin: 0 auto 56px;
  color: white;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.48);
}

.inner-hero .eyebrow {
  color: #f3dbe6;
}

.inner-hero h1 {
  font-size: clamp(40px, 5vw, 68px);
}

.inner-hero > p:last-child {
  max-width: 760px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.8;
}

.compact-hero {
  margin-bottom: 34px;
}

.demo-layout {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 42px;
}

.demo-timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.demo-timeline::before {
  content: "";
  position: absolute;
  left: 36px;
  top: 42px;
  bottom: 42px;
  width: 2px;
  background: linear-gradient(var(--school-blue), var(--school-plum), var(--school-red));
}

.demo-step {
  position: relative;
  padding: 0 0 26px 98px;
}

.step-number {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 26px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--school-blue);
  border: 7px solid var(--paper);
  border-radius: 50%;
  font-weight: 900;
}

.demo-step:nth-child(3) .step-number { background: var(--school-plum); }
.demo-step:nth-child(4) .step-number { background: #9d5064; }
.demo-step:nth-child(5) .step-number { background: var(--school-red); }

.step-copy {
  min-height: 190px;
  padding: 28px 30px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.step-tag {
  color: var(--school-blue-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.step-copy h2 {
  margin: 10px 0 10px;
  font-size: 24px;
}

.step-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compact-button {
  min-height: 42px;
  margin-top: 20px;
  padding: 9px 16px;
  font-size: 14px;
}

.sticky-card {
  position: sticky;
  top: 112px;
}

.aside-card {
  padding: 30px;
  background: linear-gradient(160deg, #102f4d, #0c416a);
  border-radius: var(--radius-xl);
  color: white;
  box-shadow: var(--shadow);
}

.aside-card h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.45;
}

.aside-card ul {
  margin: 26px 0;
  padding: 0;
  display: grid;
  gap: 16px;
  list-style: none;
}

.aside-card li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.aside-card li span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.dark-secondary {
  color: var(--school-blue);
  background: white;
  border: 1px solid var(--line);
}

.resource-panel {
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.resource-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
}

.search-box,
.select-box {
  min-height: 58px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.search-box > span,
.select-box > span {
  color: var(--school-blue);
  font-size: 12px;
  font-weight: 900;
}

.search-box input,
.select-box select {
  flex: 1;
  min-width: 0;
  height: 40px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box:focus-within,
.select-box:focus-within {
  border-color: var(--school-blue-2);
  box-shadow: 0 0 0 3px rgba(31, 93, 149, 0.1);
}

kbd {
  padding: 3px 7px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 0 #c8d2da;
}

.subject-filters {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 9px 15px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-chip.is-active {
  color: white;
  background: var(--school-blue);
  border-color: var(--school-blue);
}

.resource-result-bar {
  margin: 22px 0 14px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.resource-result-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.resource-result-bar strong {
  color: var(--school-blue);
  font-size: 18px;
}

.resource-legend {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
}

.legend-dot.online { background: var(--school-gold); }
.legend-dot.local { background: #4cae86; }

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

.resource-card {
  min-height: 190px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: var(--ink);
  text-align: left;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: 180ms ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-3px);
  background: white;
  border-color: #a9bfd2;
  box-shadow: var(--shadow-soft);
}

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

.resource-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  color: var(--school-blue);
  background: #e9f2fa;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.resource-badge.math-comic { color: #7d3858; background: #f7eaf0; }
.resource-badge.element-story { color: #947023; background: #fbf3de; }
.resource-badge.scenario { color: #58649f; background: #eceefa; }
.resource-badge.external { color: #267457; background: #e7f5ef; }

.network-label {
  color: var(--muted);
  font-size: 11px;
}

.resource-card h3 {
  margin: 17px 0 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 16px;
  line-height: 1.55;
}

.resource-tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-tags span {
  padding: 4px 7px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 5px;
  font-size: 10px;
}

.resource-open-hint {
  margin-top: 16px;
  color: var(--school-blue-2);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
}

.empty-state strong {
  font-size: 24px;
}

.empty-state p {
  color: var(--muted);
}

.pagination {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.page-button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.page-button.is-active,
.page-button:hover,
.page-button:focus-visible {
  color: white;
  background: var(--school-blue);
  border-color: var(--school-blue);
}

.page-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.security-note {
  max-width: 1500px;
  margin: 0 auto 22px;
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  color: #715319;
  background: #fff6df;
  border: 1px solid #eed49d;
  border-radius: var(--radius-md);
}

.security-note span {
  color: #806b3e;
}

.portal-grid {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.portal-card {
  position: relative;
  padding: 30px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-top: 5px solid var(--school-blue-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  transition: 220ms ease;
}

.portal-card.is-focused {
  transform: translateY(-5px);
  box-shadow: 0 0 0 4px rgba(31, 93, 149, 0.16), var(--shadow);
}

.teacher-card { border-top-color: #7658ad; }
.admin-card { border-top-color: #d48439; }

.portal-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.portal-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--school-blue-2);
  border-radius: 16px;
  font-size: 23px;
  font-weight: 900;
}

.teacher-card .portal-mark { background: #7658ad; }
.admin-card .portal-mark { background: #d48439; }

.portal-status {
  padding: 6px 10px;
  color: #237353;
  background: #e7f5ef;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.portal-status::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: #3bad7c;
}

.portal-card h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

.portal-card > p:not(.section-kicker) {
  min-height: 52px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.credential-box {
  margin-top: 26px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.credential-box > div {
  min-height: 48px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.credential-box > div + div {
  border-top: 1px solid var(--line);
}

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

.credential-box code {
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.credential-box.is-masked code {
  color: transparent;
  text-shadow: 0 0 7px rgba(16, 36, 58, 0.55);
  user-select: none;
}

.credential-box button {
  padding: 6px 9px;
  color: var(--school-blue);
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.credential-box.is-masked button {
  visibility: hidden;
}

.portal-actions {
  margin-top: 22px;
}

.portal-actions button {
  flex: 1 1 150px;
}

.image-modal {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 14, 24, 0.84);
  border: 0;
  cursor: default;
}

.modal-card {
  position: relative;
  width: min(1480px, 96vw);
  height: min(920px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #081e33;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.48);
}

.modal-header,
.modal-footer {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: white;
  background: #0b2944;
}

.modal-header span {
  color: #8ec3eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.modal-header h2 {
  max-width: min(1000px, 72vw);
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.modal-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 50%;
  font-size: 30px;
  cursor: pointer;
}

.modal-stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}

.modal-stage.has-description {
  grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 330px);
}

.modal-media {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.modal-stage.has-description .modal-media {
  padding-right: 20px;
}

.modal-media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.4);
}

.modal-description {
  align-self: stretch;
  margin: 16px 18px 16px 0;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #15334d;
  background: linear-gradient(180deg, #f8fbfd, #e9f2f8);
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
}

.modal-description span {
  color: #b73145;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.modal-description p {
  margin: 16px 0 0;
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: 700;
  line-height: 1.85;
}

.modal-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 48px;
  height: 64px;
  transform: translateY(-50%);
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 36px;
  cursor: pointer;
}

.modal-nav.previous { left: 18px; }
.modal-nav.next { right: 18px; }

.modal-stage.has-description .modal-nav.next {
  right: calc(clamp(260px, 22vw, 330px) + 28px);
}

.modal-nav:disabled {
  opacity: 0.22;
  cursor: default;
}

.modal-footer {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.modal-footer a {
  color: white;
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 500;
  left: 50%;
  bottom: 28px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 13px 18px;
  transform: translate(-50%, 30px);
  color: white;
  background: #102f4d;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .brand-copy small {
    display: none;
  }

  .value-grid,
  .featured-grid,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .portal-card > p:not(.section-kicker) {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: center;
  }

  .brand-copy,
  .header-actions {
    display: none;
  }

  .main-nav {
    margin-left: auto;
    overflow-x: auto;
  }

  .nav-link {
    white-space: nowrap;
    padding-inline: 12px;
  }

  .hero-shell {
    min-height: auto;
    padding-top: 140px;
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .home-route-dock {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
  }

  .hero-copy h1 {
    font-size: clamp(46px, 11vw, 78px);
  }

  .hero-side {
    max-width: 620px;
  }

  .gateway-banner,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }

  .resource-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 66px;
    padding-inline: 12px;
    gap: 8px;
  }

  .school-background {
    top: 66px;
  }

  .school-mark {
    width: 42px;
    height: 42px;
    font-size: 10px;
  }

  .main-nav {
    gap: 0;
    padding: 3px;
  }

  .nav-link {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .hero-shell {
    padding: 118px 18px 58px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .hero-actions > *,
  .gateway-actions,
  .gateway-pill {
    width: 100%;
  }

  .hero-mini-stats,
  .value-grid,
  .featured-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .home-content,
  .inner-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .gateway-banner {
    padding: 26px 22px;
  }

  .gateway-actions {
    display: grid;
  }

  .inner-view {
    padding-top: 108px;
  }

  .inner-hero {
    margin-bottom: 34px;
  }

  .inner-hero h1 {
    font-size: 38px;
  }

  .inner-hero > p:last-child {
    font-size: 15px;
  }

  .demo-timeline::before {
    left: 21px;
  }

  .demo-step {
    padding-left: 60px;
  }

  .step-number {
    top: 20px;
    width: 44px;
    height: 44px;
    border-width: 5px;
    font-size: 11px;
  }

  .step-copy {
    padding: 22px;
  }

  .step-copy h2 {
    font-size: 20px;
  }

  .resource-panel,
  .portal-card {
    padding: 18px;
    border-radius: 18px;
  }

  .resource-result-bar,
  .security-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-legend {
    display: none;
  }

  .modal-card {
    width: 100%;
    height: 94vh;
  }

  .modal-media {
    padding: 12px 15px;
  }

  .modal-stage.has-description {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .modal-stage.has-description .modal-media {
    padding: 12px 15px 0;
  }

  .modal-description {
    margin: 0 14px 14px;
    padding: 16px 18px;
  }

  .modal-description p {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.65;
  }

  .modal-nav {
    top: auto;
    bottom: 16px;
    width: 42px;
    height: 42px;
    transform: none;
  }

  .modal-nav.previous { left: 16px; }
  .modal-nav.next { right: 16px; }
  .modal-stage.has-description .modal-nav.next { right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
