:root {
  color-scheme: light;
  --blue: #354882;
  --blue-deep: #23335f;
  --red: #c22723;
  --red-deep: #a51f1c;
  --gold: #d8a83d;
  --paper: #ffffff;
  --bg: #f4f5f8;
  --ink: #1f2430;
  --muted: #687082;
  --line: #dfe3ec;
  --soft-blue: #eef2fb;
  --soft-red: #fff2f0;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(28, 40, 68, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(28, 40, 68, 0.08);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  min-height: 88px;
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}

.text-brand {
  color: var(--blue-deep);
  font-weight: 900;
}

.brand-text {
  display: inline-flex;
  align-items: center;
  min-width: 176px;
  min-height: 58px;
  border-bottom: 4px solid var(--red);
  color: var(--blue-deep);
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-text.loaded {
  justify-content: center;
}

.brand-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  animation: brand-rise 0.38s ease forwards;
}

.brand-delay-0 {
  animation-delay: 0ms;
}

.brand-delay-1 {
  animation-delay: 80ms;
}

.brand-delay-2 {
  animation-delay: 160ms;
}

.brand-delay-3 {
  animation-delay: 240ms;
}

.brand-delay-4 {
  animation-delay: 320ms;
}

.brand-delay-5 {
  animation-delay: 400ms;
}

.brand-delay-6 {
  animation-delay: 480ms;
}

.brand-delay-7 {
  animation-delay: 560ms;
}

.brand-delay-8 {
  animation-delay: 640ms;
}

.brand-delay-9 {
  animation-delay: 720ms;
}

@keyframes brand-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--red);
}

.site-header nav a {
  min-width: 150px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.site-header nav a:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.site-header nav a:hover {
  background: #fff;
  color: var(--blue);
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 52px;
}

.school-hero {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: var(--blue-deep);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.school-hero > img {
  width: 100%;
  height: 460px;
  object-fit: cover;
}

.school-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(22, 31, 59, 0.82), rgba(22, 31, 59, 0.42), rgba(22, 31, 59, 0.1));
}

.hero-copy {
  position: absolute;
  inset: auto auto 46px 46px;
  z-index: 1;
  max-width: 650px;
  color: #fff;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 16px 0 0;
  max-width: 610px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary,
.secondary,
.ghost,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary,
button {
  background: var(--red);
  color: #fff;
}

.primary:hover,
button:hover {
  background: var(--red-deep);
}

button:disabled {
  cursor: default;
  opacity: 0.72;
}

button:disabled:hover {
  background: var(--red);
}

.welcome-modal[hidden] {
  display: none;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 24, 38, 0.46);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.welcome-modal.is-visible {
  opacity: 1;
}

.welcome-modal__panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(18, 24, 38, 0.26);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.18s ease;
}

.welcome-modal.is-visible .welcome-modal__panel {
  transform: translateY(0) scale(1);
}

.welcome-modal__eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.welcome-modal h2 {
  margin: 0;
  color: var(--blue-deep);
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: 0;
}

.welcome-modal p:not(.welcome-modal__eyebrow) {
  margin: 14px 0 22px;
  color: #384155;
}

.welcome-modal button {
  width: 100%;
}

.secondary {
  background: #fff;
  color: var(--blue);
  border-color: var(--line);
}

.secondary:hover {
  border-color: var(--blue);
}

.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

.campus-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.campus-strip div {
  padding: 18px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.campus-strip div:last-child {
  border-right: 0;
}

.campus-strip strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.campus-strip span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.feature-grid article {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--blue);
  box-shadow: var(--shadow);
}

.feature-grid img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.feature-grid article:hover img {
  transform: scale(1.04);
}

.feature-grid article::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 36, 48, 0.06), rgba(31, 36, 48, 0.82));
}

.feature-grid article div {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 1;
  color: #fff;
}

.feature-grid span {
  display: block;
  font-size: 20px;
  font-weight: 900;
}

.feature-grid p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.home-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.home-entry p:last-child {
  margin-bottom: 0;
}

.toolbar,
.panel,
.post-card,
.empty,
.stats div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 560px);
  align-items: end;
  gap: 16px;
  padding: 18px;
  margin-bottom: 12px;
}

.toolbar > div:only-child {
  grid-column: 1 / -1;
}

.toolbar h2,
.panel h1,
.panel h2,
.admin-head h1 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.toolbar h2,
.panel h2 {
  font-size: 26px;
}

.panel h1,
.admin-head h1 {
  font-size: 36px;
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(194, 39, 35, 0.12);
  border-color: var(--red);
}

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

.post-card,
.empty,
.panel {
  padding: 20px;
}

.post-card {
  border-top: 4px solid var(--blue);
}

.post-card:hover {
  border-top-color: var(--red);
}

.announcements-feed {
  grid-template-columns: 1fr;
}

.announcement-card {
  border-top-color: var(--red);
}

.announcement-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.announcement-empty h2 {
  color: rgba(31, 36, 48, 0.26);
  font-size: 28px;
}

.post-head,
.meta,
.comment div:first-child,
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

time,
.meta,
.muted,
.author,
.site-footer {
  color: var(--muted);
}

.post-card h2,
.moderation-item h3 {
  margin: 12px 0 8px;
  line-height: 1.28;
  letter-spacing: 0;
}

.post-card h2 {
  font-size: 21px;
}

.post-card h2 a:hover {
  color: var(--red);
}

.post-card p {
  margin: 0;
  color: #39455c;
}

.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 14px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.card-link:hover {
  background: var(--blue);
  color: #fff;
}

.meta {
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 14px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
}

label input,
label select,
label textarea {
  font-weight: 400;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 82px;
  gap: 8px;
  align-items: center;
}

.captcha-image {
  width: 170px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.captcha-refresh {
  min-height: 48px;
  padding-inline: 10px;
  white-space: nowrap;
}

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

.compact {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 14px;
}

.identity-card,
.login-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
  background: var(--soft-blue);
  border: 1px solid #d7dff3;
  border-radius: 8px;
}

.identity-card strong {
  display: block;
  font-size: 18px;
}

.identity-card span,
.login-callout p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.account-panel {
  max-width: 720px;
  margin-inline: auto;
}

.account-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.account-stats span {
  margin: 0;
  padding: 5px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flash {
  margin: 12px 0;
  padding: 12px 14px;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  border-radius: 8px;
}

.flash.error {
  background: #fef3f2;
  border-color: #fecdca;
  color: var(--danger);
}

.detail .content {
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  white-space: normal;
}

.inline-actions {
  display: inline-flex;
  margin: 0 8px 8px 0;
}

.inline-link {
  margin: 0 8px 8px 0;
}

.inline-actions button,
.comment button,
.moderation-item button {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 14px;
}

.comments {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
}

.comment {
  padding: 12px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comment p {
  margin: 8px 0 0;
}

.link-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-weight: 400;
}

.link-button:hover {
  background: transparent;
  color: var(--danger);
}

.auth {
  max-width: 460px;
  margin-inline: auto;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stats div {
  padding: 16px;
}

.stats strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
}

.moderation-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.moderation-item:last-child {
  border-bottom: 0;
}

.moderation-item form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.announcement-admin-form {
  margin-bottom: 18px;
}

.announcement-editor form {
  display: grid;
}

.reporters {
  margin: 8px 0 0;
  color: #39455c;
  font-size: 14px;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #912018;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.visit-table {
  min-width: 1120px;
}

.visit-agent {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
}

.user-table th,
.user-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.user-table th {
  color: var(--muted);
  font-size: 14px;
}

.user-table tr:last-child td {
  border-bottom: 0;
}

.user-table form {
  margin: 0;
}

.user-table button {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.disabled {
  background: #fef3f2;
  border-color: #fecdca;
  color: var(--danger);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.pagination a {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.pagination a.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 24px max(20px, calc((100% - 1200px) / 2));
  background: var(--blue);
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 900px) {
  .masthead {
    align-items: center;
    flex-direction: column;
    min-height: auto;
  }

  .brand {
    min-height: 54px;
  }

  .brand-text {
    min-width: 136px;
    min-height: 48px;
    font-size: 34px;
  }

  .site-header nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    justify-content: stretch;
  }

  .site-header nav a {
    min-width: 0;
    height: 48px;
    padding: 0 4px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .container {
    width: min(100% - 24px, 1200px);
    margin-top: 14px;
  }

  .school-hero,
  .school-hero > img {
    min-height: 420px;
    height: 420px;
  }

  .hero-copy {
    left: 22px;
    right: 22px;
    bottom: 24px;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .toolbar,
  .search,
  .feed,
  .feature-grid,
  .campus-strip,
  .stats {
    grid-template-columns: 1fr;
  }

  .home-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .campus-strip div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .campus-strip div:last-child {
    border-bottom: 0;
  }

  .primary,
  .secondary,
  .ghost,
  button {
    width: 100%;
  }

  .welcome-modal {
    align-items: end;
    padding: 14px;
  }

  .welcome-modal__panel {
    padding: 22px;
  }

  .welcome-modal h2 {
    font-size: 24px;
  }

  .captcha-row {
    grid-template-columns: minmax(0, 1fr) 126px;
  }

  .captcha-image {
    width: 126px;
    height: 42px;
  }

  .captcha-refresh {
    grid-column: 1 / -1;
    min-height: 40px;
  }

  .identity-card,
  .login-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .account-stats {
    justify-content: flex-start;
  }

  .site-footer {
    flex-direction: column;
    padding-inline: 20px;
  }
}
