:root {
  --navy: #073b73;
  --blue: #078fd1;
  --deep-blue: #0753a7;
  --orange: #ff8a1f;
  --ink: #102033;
  --muted: #65758a;
  --line: #dce6ef;
  --soft: #f3f8fc;
  --white: #ffffff;
  --success: #14845d;
  --warning: #a96308;
  --shadow: 0 22px 60px rgba(7, 59, 115, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
}

.brand span,
.footer-brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand strong {
  font-size: 19px;
}

.brand small,
.footer-brand small {
  color: var(--muted);
  font-size: 12px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header nav a,
.site-header nav button {
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.site-header nav .nav-admin {
  padding: 9px 16px;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 999px;
}

main {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 650px;
  padding: 88px max(32px, calc((100vw - 1180px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  align-items: center;
  gap: 80px;
  background:
    radial-gradient(circle at 86% 15%, rgba(255, 138, 31, 0.2), transparent 25%),
    radial-gradient(circle at 12% 92%, rgba(7, 143, 209, 0.2), transparent 28%),
    linear-gradient(135deg, #f7fbff 0%, #ffffff 48%, #eef7fd 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -160px 38%;
  height: 300px;
  border: 46px solid rgba(7, 83, 167, 0.06);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--deep-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.hero h1 em {
  color: var(--deep-blue);
  font-style: normal;
}

.hero-copy > p {
  max-width: 670px;
  margin: 28px 0 34px;
  color: var(--muted);
  font-size: 18px;
}

.hero-search {
  max-width: 720px;
  padding: 8px 8px 8px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid rgba(7, 59, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-icon {
  color: var(--blue);
  font-size: 28px;
  line-height: 1;
  transform: rotate(-20deg);
}

.hero-search input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.hero-search button,
.primary-button {
  padding: 13px 22px;
  color: var(--white);
  background: linear-gradient(135deg, var(--deep-blue), var(--blue));
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(7, 83, 167, 0.2);
}

.search-examples {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.search-examples button {
  padding: 2px 8px;
  color: var(--deep-blue);
  background: none;
  border: 0;
  font-weight: 700;
}

.hero-card {
  position: relative;
  z-index: 1;
  min-height: 400px;
  padding: 44px 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 44px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.hero-card img {
  position: relative;
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 36px;
}

.hero-card > strong {
  margin-top: 22px;
  font-size: 24px;
}

.hero-card > p {
  margin: 5px 0 24px;
  color: var(--muted);
}

.hero-orbit {
  position: absolute;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(7, 143, 209, 0.18);
  border-radius: 50%;
}

.hero-stats {
  width: 100%;
  padding-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.hero-stats span {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 12px;
}

.hero-stats span + span {
  border-left: 1px solid var(--line);
}

.hero-stats b {
  color: var(--navy);
  font-size: 26px;
}

.universities,
.catalog {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 92px 0 10px;
}

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

.section-heading h2,
.contact-section h2,
.admin-tools h2,
.admin-table-section h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.03em;
}

.section-heading p,
.admin-tools p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

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

.university-card {
  min-height: 104px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.university-card:hover {
  transform: translateY(-3px);
  border-color: rgba(7, 143, 209, 0.45);
  box-shadow: 0 14px 30px rgba(7, 59, 115, 0.09);
}

.university-mark {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: 13px;
  font-size: 12px;
  font-weight: 850;
}

.university-card > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.university-card small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.university-card b {
  min-width: 28px;
  padding: 3px 8px;
  color: var(--deep-blue);
  background: var(--soft);
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
}

.catalog {
  padding-bottom: 100px;
}

.filter-panel {
  margin-bottom: 30px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1.8fr repeat(5, 1fr) auto;
  align-items: end;
  gap: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.filter-panel label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-panel label > span,
.form-grid label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.filter-panel input,
.filter-panel select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.admin-search input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.filter-panel input:focus,
.filter-panel select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.admin-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(7, 143, 209, 0.1);
}

.ghost-button,
.secondary-button {
  padding: 10px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy);
  font-weight: 700;
}

.secondary-button {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.course-card {
  min-height: 338px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.course-card-top,
.material-title,
.material-heading,
.dialog-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.university-pill,
.status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.university-pill {
  color: var(--deep-blue);
  background: #e9f5fc;
}

.status-可提供 {
  color: var(--success);
  background: #e7f7f0;
}

.status-更新中 {
  color: var(--warning);
  background: #fff2df;
}

.status-暂缺,
.status-下架 {
  color: #8b4a52;
  background: #fae9eb;
}

.course-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 30px;
  letter-spacing: -0.02em;
}

.course-name {
  min-height: 48px;
  margin: 2px 0 0;
  color: var(--muted);
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 12px;
}

.material-tags,
.material-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.material-tags span,
.material-facts span {
  padding: 4px 8px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 7px;
  font-size: 11px;
}

.course-card-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.course-card-footer > span {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 11px;
}

.course-card-footer strong {
  color: var(--orange);
  font-size: 19px;
}

.course-card-footer button {
  padding: 0;
  color: var(--deep-blue);
  background: none;
  border: 0;
  font-weight: 800;
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--soft);
  border: 1px dashed #bfd2e2;
  border-radius: var(--radius);
}

.empty-state h3 {
  margin: 5px 0;
  color: var(--navy);
  font-size: 28px;
}

.empty-state a {
  display: inline-block;
  margin-top: 12px;
  color: var(--deep-blue);
  font-weight: 800;
}

.contact-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 100px;
  padding: 54px;
  display: grid;
  grid-template-columns: 1fr 330px;
  align-items: center;
  gap: 70px;
  color: var(--white);
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 138, 31, 0.4), transparent 24%),
    linear-gradient(135deg, #062f5c, #0753a7);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.contact-section .eyebrow {
  color: #83d4f6;
}

.contact-section h2 {
  color: var(--white);
}

.contact-copy > p {
  color: rgba(255, 255, 255, 0.74);
}

.contact-items {
  margin: 28px 0;
  display: flex;
  gap: 32px;
}

.contact-items div {
  display: flex;
  flex-direction: column;
}

.contact-items small {
  color: rgba(255, 255, 255, 0.6);
}

.qr-card {
  padding: 18px;
  color: var(--muted);
  background: var(--white);
  border-radius: 22px;
  text-align: center;
}

.qr-card img {
  width: 100%;
  max-height: 330px;
  object-fit: cover;
  object-position: center 42%;
  border-radius: 13px;
}

.qr-card p {
  margin: 10px 0 0;
  font-size: 13px;
}

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
}

.footer-brand img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
}

dialog {
  padding: 0;
  border: 0;
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(5, 29, 56, 0.28);
}

dialog::backdrop {
  background: rgba(5, 25, 45, 0.68);
  backdrop-filter: blur(6px);
}

.course-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
}

.dialog-close {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.dialog-hero {
  padding: 42px 44px 34px;
  background:
    radial-gradient(circle at 85% 25%, rgba(255, 138, 31, 0.25), transparent 28%),
    linear-gradient(135deg, #eef8ff, #ffffff);
}

.dialog-hero h2 {
  margin: 18px 0 0;
  color: var(--navy);
  font-size: 46px;
}

.dialog-hero > p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.dialog-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-body {
  padding: 32px 44px 44px;
}

.dialog-body section + section {
  margin-top: 34px;
}

.dialog-body h3 {
  margin: 0 0 12px;
  color: var(--navy);
}

.material-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.material-list {
  display: grid;
  gap: 12px;
}

.material-card {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.material-title h4 {
  margin: 3px 0 0;
  font-size: 17px;
}

.material-title div > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.material-title > strong {
  color: var(--orange);
  font-size: 22px;
}

.material-card > p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.material-contact {
  margin-top: 14px;
  padding: 0;
  color: var(--deep-blue);
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.preview-placeholder {
  min-height: 200px;
  padding: 24px;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: center;
  gap: 25px;
  color: var(--white);
  background:
    linear-gradient(rgba(7, 59, 115, 0.84), rgba(7, 83, 167, 0.88)),
    linear-gradient(135deg, var(--navy), var(--blue));
  border-radius: 18px;
  overflow: hidden;
}

.preview-placeholder > div:first-child {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  transform: rotate(-2deg);
}

.preview-placeholder p {
  color: rgba(255, 255, 255, 0.72);
}

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.preview-gallery a {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  color: var(--white);
  background: var(--soft);
  border-radius: 14px;
}

.preview-gallery img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease;
}

.preview-gallery a:hover img {
  transform: scale(1.03);
}

.preview-gallery span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  padding: 7px 9px;
  overflow: hidden;
  background: rgba(5, 32, 60, 0.78);
  border-radius: 8px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-card {
  grid-column: 1 / -1;
  padding: 70px 20px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.dialog-contact {
  padding: 22px;
  background: var(--soft);
  border-radius: 16px;
}

.dialog-contact p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  padding: 11px 18px;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: 180ms ease;
}

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

.admin-body {
  background: #f4f8fb;
}

.login-main {
  min-height: calc(100vh - 89px);
  padding: 70px 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 75% 15%, rgba(255, 138, 31, 0.18), transparent 25%),
    radial-gradient(circle at 20% 85%, rgba(7, 143, 209, 0.2), transparent 28%),
    #f4f8fb;
}

.login-card {
  width: min(440px, 100%);
  padding: 38px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.login-card > img {
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  object-fit: cover;
  border-radius: 18px;
}

.login-card h1 {
  margin: 0;
  color: var(--navy);
  font-size: 36px;
}

.login-card > p {
  margin: 8px 0 24px;
  color: var(--muted);
}

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

.login-card label,
.preview-dialog label {
  display: grid;
  gap: 6px;
}

.login-card label span,
.preview-dialog label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-card input,
.preview-dialog select,
.upload-drop {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.login-help,
.form-note {
  min-height: 24px;
  color: var(--warning) !important;
  font-size: 12px;
}

.admin-header {
  width: 100%;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.admin-main {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 50px 0 90px;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.admin-hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: 48px;
  line-height: 1.15;
}

.admin-hero p {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
}

.admin-stats {
  margin: 30px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.admin-stats div {
  min-height: 120px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 17px;
}

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

.admin-stats strong {
  color: var(--navy);
  font-size: 28px;
}

.admin-tools,
.admin-table-section {
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.admin-tools {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.admin-tools h2,
.admin-table-section h2 {
  font-size: 26px;
}

.tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-button input {
  display: none;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 20px;
}

.admin-search input {
  min-width: 280px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 12px 14px;
  color: var(--muted);
  background: var(--soft);
  text-align: left;
  font-size: 11px;
  white-space: nowrap;
}

td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

td strong,
td small {
  display: block;
}

td small {
  color: var(--muted);
  max-width: 280px;
}

.path-cell {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  white-space: nowrap;
}

.row-actions button {
  padding: 5px 8px;
  color: var(--deep-blue);
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.row-actions .danger {
  color: #b03a47;
}

.table-empty {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

.editor-dialog {
  width: min(820px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 32px;
}

.editor-heading {
  margin-bottom: 25px;
}

.editor-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-grid textarea {
  resize: vertical;
}

.editor-actions {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.preview-dialog {
  width: min(600px, calc(100% - 28px));
}

.preview-dialog form {
  display: grid;
  gap: 18px;
}

.upload-drop {
  padding: 22px;
  background: var(--soft);
  border-style: dashed;
}

.upload-drop input {
  margin-top: 10px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 1080px) {
  .filter-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-search {
    grid-column: span 2;
  }

  .university-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .site-header {
    min-height: 76px;
  }

  .brand img {
    width: 47px;
    height: 47px;
  }

  .brand small,
  .site-header nav > a:not(.nav-admin) {
    display: none;
  }

  .site-header nav {
    gap: 8px;
  }

  .hero {
    min-height: auto;
    padding-top: 65px;
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .hero-card {
    min-height: 330px;
  }

  .university-grid,
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-section {
    grid-template-columns: 1fr 270px;
    gap: 30px;
    padding: 34px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-tools {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-header {
    width: calc(100% - 28px);
  }

  .site-header nav .nav-admin {
    padding: 7px 10px;
    font-size: 12px;
  }

  .hero {
    padding: 50px 18px 68px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero-copy > p {
    margin: 20px 0 26px;
    font-size: 16px;
  }

  .hero-search {
    padding: 8px 8px 8px 14px;
    grid-template-columns: auto 1fr;
  }

  .hero-search button {
    grid-column: 1 / -1;
  }

  .hero-card {
    padding: 34px 22px 24px;
  }

  .universities,
  .catalog,
  .contact-section,
  footer,
  .admin-main {
    width: calc(100% - 28px);
  }

  .universities,
  .catalog {
    padding-top: 68px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .university-grid {
    display: flex;
    margin-right: -14px;
    padding-right: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .university-card {
    min-width: 245px;
    scroll-snap-align: start;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
  }

  .filter-search {
    grid-column: 1 / -1;
  }

  #clear-filters {
    grid-column: 1 / -1;
  }

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

  .course-card {
    min-height: 315px;
  }

  .contact-section {
    margin-bottom: 60px;
    padding: 30px 22px;
    grid-template-columns: 1fr;
  }

  .contact-items {
    flex-direction: column;
    gap: 12px;
  }

  .qr-card {
    width: min(100%, 320px);
    margin: 0 auto;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-hero {
    padding: 34px 22px 26px;
  }

  .dialog-hero h2 {
    font-size: 36px;
  }

  .dialog-body {
    padding: 26px 20px 34px;
  }

  .preview-placeholder {
    grid-template-columns: 1fr;
  }

  .preview-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-contact {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .tool-buttons {
    width: 100%;
    flex-direction: column;
  }

  .tool-buttons > * {
    width: 100%;
    text-align: center;
  }

  .admin-search input {
    min-width: 0;
  }

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

  .form-grid .full-width {
    grid-column: auto;
  }

  .editor-dialog {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
