:root {
  --navy: #0c2340;
  --blue: #1a5fb4;
  --gold: #c5a059;
  --muted: #5c6b7a;
  --bg: #f8fafc;
  --card: #fff;
  --border: #e2e8f0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: #0f172a;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.site-header {
  position: relative;
  z-index: 10;
  background:
    linear-gradient(90deg, rgba(255,255,255,.74), rgba(255,255,255,.56)),
    var(--header-bg-image, none) center/100% 100% no-repeat,
    #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  backdrop-filter: blur(10px);
}
.topbar { background: rgba(12,35,64,.92); color: #fff; font-size: 0.875rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.topbar a { color: #e2e8f0; }
.topbar a:hover { color: #fff; }
.topbar .sep { margin: 0 0.5rem; opacity: 0.5; }
.header-main { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; min-height: 150px; padding: 2rem 0; }
.brand { display: flex; gap: 0.75rem; align-items: center; }
.logo { width: var(--site-logo-height, 56px); height: var(--site-logo-height, 56px); border-radius: 0.5rem;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
.logo-img {
  width: auto;
  height: var(--site-logo-height, 56px);
  max-width: min(260px, calc(var(--site-logo-height, 56px) * 4));
  max-height: 120px;
  object-fit: contain;
  display: block;
}
.site-title { font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.site-motto { font-size: 0.75rem; color: var(--muted); }
@media (max-width: 520px) {
  .logo-img {
    max-width: min(240px, calc(var(--site-logo-height, 56px) * 4));
  }
}
.site-search {
  display: flex;
  align-items: center;
  width: min(100%, 22rem);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.site-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  outline: none;
}
.site-search button {
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--border);
  padding: 0 0.8rem;
  background: #f8fafc;
  color: var(--navy);
  cursor: pointer;
  font-weight: 600;
}
.site-search button:hover { background: #eff6ff; color: var(--blue); }
.main-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; width: 100%; }
.main-nav a { position: relative; color: #334155; padding-bottom: .2rem; transition: color .2s ease; }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .24s ease;
}
.main-nav a:hover { color: var(--blue); text-decoration: none; }
.main-nav a:hover::after, .main-nav a.is-active::after { transform: scaleX(1); }
.main-nav a.is-active { color: var(--blue); font-weight: 700; }

.layout { display: flex; flex-direction: column; gap: 2rem; padding: 2rem 1rem; }
@media (min-width: 1024px) {
  .layout { flex-direction: row; align-items: flex-start; }
  .main { flex: 1; min-width: 0; }
  .sidebar { width: 14rem; flex-shrink: 0; }
}

.sidebar .card { margin-bottom: 1rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem;
  padding: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15,23,42,.08); border-color: rgba(26,95,180,.2); }
.card h3 { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--navy); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: 0.35rem; }
.sidebar a { display: block; padding: 0.35rem 0.5rem; border-radius: 0.35rem; color: #334155; }
.sidebar a:hover { background: #f1f5f9; text-decoration: none; }
.sidebar small { display: block; margin-top: 0.15rem; color: #94a3b8; font-size: 0.7rem; }
.card-muted { background: linear-gradient(135deg, rgba(26,95,180,.06), #fff); font-size: 0.875rem; color: var(--muted); }
.btn-top {
  display: none; width: 100%; padding: 0.5rem; border-radius: 0.5rem;
  border: 1px solid rgba(197,160,89,.5); background: #fffbeb; color: #78350f; font-weight: 500; cursor: pointer;
}
@media (min-width: 1024px) { .btn-top { display: block; } }

.site-footer {
  border-top: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(255,255,255,.74), rgba(248,250,252,.64)),
    var(--footer-bg-image, none) center/100% 100% no-repeat,
    var(--card);
  min-height: 220px;
  padding: 3rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer .fname { font-weight: 600; color: var(--navy); margin: 0; }
.site-footer .beian { font-size: 0.75rem; }
.site-footer .footer-note { color: var(--muted); }

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(12,35,64,.12);
  border-radius: 0.75rem;
  background:
    linear-gradient(90deg, rgba(12,35,64,.9), rgba(12,35,64,.42), rgba(12,35,64,.18)),
    var(--header-bg-image, none) center/cover no-repeat,
    linear-gradient(135deg, var(--navy), var(--blue));
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
  min-height: 360px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 34%, rgba(255,255,255,.24) 45%, transparent 56% 100%);
  transform: translateX(-120%);
  animation: hero-shine 4.8s ease-in-out 1s infinite;
}
.hero-grid { display: grid; gap: 0; min-height: 360px; }
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 3fr 2fr; }
}
.hero-main {
  position: relative;
  background: transparent;
  color: #fff; padding: 2.5rem; min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-main::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 7rem;
  height: 7rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
}
.hero-main .kicker { font-size: 0.75rem; letter-spacing: 0.1em; opacity: 0.8; margin: 0; }
.hero-main h1 { max-width: 36rem; margin: 0.65rem 0; font-size: 2rem; line-height: 1.25; text-shadow: 0 2px 12px rgba(0,0,0,.28); }
@media (min-width: 768px) { .hero-main h1 { font-size: 2.65rem; } }
.hero-main .lead { max-width: 34rem; opacity: 0.94; font-size: 1rem; margin: 0.5rem 0 0; text-shadow: 0 1px 8px rgba(0,0,0,.28); }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-side {
  align-self: end;
  margin: 1.5rem;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: .75rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(15,23,42,.16);
}
@media (min-width: 768px) {
  .hero-side { border-top: 1px solid rgba(255,255,255,.28); border-left: 1px solid rgba(255,255,255,.28); }
}
.hero-side h3 { margin: 0 0 0.75rem; font-size: 0.9rem; color: var(--navy); border: 0; padding: 0; }
.hero-side ul { margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.hero-side li { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.hero-side li:last-child { border-bottom: 0; }
.btn {
  display: inline-block; padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; margin-top: 1rem;
}
.btn.primary { background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(4px); border: 0; cursor: pointer; }
.btn.primary:hover { background: rgba(255,255,255,.3); text-decoration: none; }
.btn.ghost { border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.12); text-decoration: none; }

.feature-strip {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
@media (min-width: 768px) { .feature-strip { grid-template-columns: repeat(3, 1fr); } }
.feature-strip div {
  border-left: 4px solid var(--gold);
  background: #fff;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .24s ease, box-shadow .24s ease;
}
.feature-strip div:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.feature-strip strong { display: block; color: var(--navy); font-size: 0.95rem; }
.feature-strip span { color: var(--muted); font-size: 0.8rem; }

.campus-stats {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
@media (min-width: 768px) { .campus-stats { grid-template-columns: repeat(4, 1fr); } }
.campus-stats div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  transition: transform .24s ease, box-shadow .24s ease;
}
.campus-stats div:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.campus-stats strong {
  display: block;
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.2;
}
.campus-stats span { color: var(--muted); font-size: 0.82rem; }

.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 960px) { .two-col { grid-template-columns: 2fr 1fr; } }
.card-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; margin-bottom: 0.5rem; }
.card-head h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.news-list li:last-child { border-bottom: 0; }
.datebox { width: 3rem; text-align: center; font-size: 0.7rem; color: var(--muted); flex-shrink: 0; }
.datebox .d { display: block; font-size: 1.1rem; font-weight: 700; color: var(--blue); }
.news-list .t { font-weight: 600; color: #0f172a; }
.news-list .ex { font-size: 0.875rem; color: #475569; margin: 0.25rem 0 0; }
.news-list .meta { font-size: 0.75rem; color: #94a3b8; margin: 0.25rem 0 0; }
.grid-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.grid-links a {
  display: block; text-align: center; padding: 0.5rem; font-size: 0.875rem;
  border: 1px solid var(--border); border-radius: 0.5rem; background: #f8fafc; color: #334155;
}
.grid-links a:hover { border-color: rgba(26,95,180,.35); background: #eff6ff; text-decoration: none; }
.tip { font-size: 0.875rem; border-style: dashed; border-color: rgba(197,160,89,.5); background: #fffbeb; color: #78350f; }
.tip code { font-size: 0.8em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.notice-card { margin-top: 1rem; }
.compact-list { margin: 0; padding: 0; list-style: none; }
.compact-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.compact-list li:last-child { border-bottom: 0; }

.portal-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
@media (min-width: 768px) { .portal-grid { grid-template-columns: repeat(4, 1fr); } }
.portal-card {
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  border-radius: 0.75rem;
  color: #fff;
  background: linear-gradient(135deg, #0c2340, #1a5fb4);
  box-shadow: 0 8px 20px rgba(15,23,42,.12);
  transform: translateY(0);
  transition: transform .24s ease, box-shadow .24s ease, filter .24s ease;
}
.portal-card:nth-child(2n) { background: linear-gradient(135deg, #164e63, #1d9a8a); }
.portal-card:nth-child(3n) { background: linear-gradient(135deg, #3b2f1e, #c5a059); }
.portal-card:hover { text-decoration: none; filter: brightness(1.04); transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,23,42,.16); }
.portal-card span { font-weight: 700; font-size: 1.05rem; }
.portal-card small { color: rgba(255,255,255,.82); margin-top: 0.2rem; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.75rem 0 .85rem;
}
.section-head .kicker {
  margin: 0 0 .15rem;
  color: var(--gold);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.section-head h2 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.section-head a { font-size: .875rem; font-weight: 600; }
.campus-gallery { overflow: hidden; position: relative; }
.campus-gallery::before,
.campus-gallery::after {
  content: "";
  position: absolute;
  top: 4.4rem;
  bottom: .75rem;
  width: 3.5rem;
  z-index: 2;
  pointer-events: none;
}
.campus-gallery::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.campus-gallery::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.gallery-stage { position: relative; }
.gallery-showcase { padding: .5rem 0 1rem; }
.gallery-rail {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(320px, 1.45fr) minmax(0, .72fr);
  align-items: center;
  gap: 1.25rem;
  min-height: 25rem;
  overflow: visible;
  padding: 2rem 3.5rem 2.6rem;
}
.gallery-rail::-webkit-scrollbar { display: none; }
.gallery-item {
  position: relative;
  width: 100%;
  min-height: 16rem;
  margin: 0;
  border-radius: .75rem;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
  isolation: isolate;
  opacity: .68;
  transform: scale(.9);
  filter: saturate(.85);
  transition: transform .55s ease, opacity .55s ease, filter .55s ease, box-shadow .55s ease;
}
.gallery-item:nth-child(2n),
.gallery-item:nth-child(3n) { margin-top: 0; }
.gallery-active-item {
  min-height: 21rem;
  opacity: 1;
  transform: scale(1.04);
  filter: saturate(1.08);
  box-shadow: 0 22px 50px rgba(15,23,42,.26);
  z-index: 3;
}
.gallery-preview { min-height: 14.5rem; }
.gallery-prev-item { transform-origin: right center; }
.gallery-next-item { transform-origin: left center; }
.gallery-stage.is-swapping .gallery-active-item { animation: gallery-focus .48s ease both; }
.gallery-item img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .45s ease, filter .45s ease;
}
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(12,35,64,.82));
  z-index: 1;
}
.gallery-item figcaption {
  position: absolute;
  left: 1rem;
  bottom: .85rem;
  z-index: 2;
  color: #fff;
  font-weight: 700;
  transform: translateY(.35rem);
  opacity: .88;
  transition: transform .3s ease, opacity .3s ease;
}
.gallery-item:hover img { transform: scale(1.08); filter: saturate(1.08); }
.gallery-item:hover figcaption { transform: translateY(0); opacity: 1; }
.gallery-control {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(12,35,64,.72);
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform .2s ease, background .2s ease;
}
.gallery-control:hover { background: rgba(26,95,180,.86); transform: translateY(-50%) scale(1.06); }
.gallery-prev { left: .5rem; }
.gallery-next { right: .5rem; }
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin: .15rem 0 1rem;
}
.gallery-dots button {
  width: .55rem;
  height: .55rem;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: width .22s ease, background .22s ease;
}
.gallery-dots button.is-active { width: 1.5rem; background: var(--blue); }
.gallery-empty { margin-top: .75rem; }
@media (max-width: 720px) {
  .section-head { align-items: flex-start; flex-direction: column; }
  .gallery-rail {
    grid-template-columns: .42fr 1fr .42fr;
    min-height: 16rem;
    padding: 1rem 2.5rem 1.25rem;
    gap: .5rem;
  }
  .gallery-item { min-height: 9.5rem; border-radius: .55rem; }
  .gallery-active-item { min-height: 13rem; transform: scale(1.03); }
  .gallery-control { width: 2.25rem; height: 2.25rem; }
}

.page-head h1 { margin: 0; color: var(--navy); }
.post-cards { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.post-card { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.post-card-main { min-width: 0; }
.post-card a { font-weight: 600; color: #0f172a; font-size: 1.05rem; }
.post-card p { margin: 0.35rem 0 0; font-size: 0.9rem; color: #475569; }
.post-card .meta { font-size: 0.75rem; color: #94a3b8; }
.post-card-date {
  width: 4.25rem;
  flex-shrink: 0;
  text-align: center;
  border-left: 3px solid var(--gold);
  background: #f8fafc;
  padding: 0.4rem 0.3rem;
  color: var(--muted);
}
.post-card-date strong { display: block; color: var(--navy); font-size: 1rem; line-height: 1.2; }
.post-card-date span { display: block; font-size: 0.72rem; }
@media (max-width: 520px) {
  .post-card { flex-direction: column; }
  .post-card-date { width: 100%; text-align: left; }
}

.search-panel h1 { margin: 0 0 0.75rem; color: var(--navy); }
.search-page-form { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.search-page-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.search-results .post-card { display: block; }
@media (max-width: 520px) {
  .search-page-form { flex-direction: column; }
  .search-page-form .btn-solid { width: 100%; }
}

.portal-login {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}
@media (min-width: 860px) { .portal-login { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); } }
.portal-login-info {
  min-height: 24rem;
  border-radius: 0.75rem;
  padding: 2rem;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(12,35,64,.96), rgba(26,95,180,.82)),
    linear-gradient(45deg, transparent 0 48%, rgba(255,255,255,.12) 49% 51%, transparent 52% 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.portal-login-info .kicker { margin: 0 0 .5rem; font-size: .78rem; letter-spacing: .08em; opacity: .78; }
.portal-login-info h1 { margin: 0; font-size: 2rem; line-height: 1.2; }
.portal-login-info p { max-width: 34rem; margin: .75rem 0 0; opacity: .9; }
.portal-login-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.portal-login-links a {
  color: #fff;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: .5rem;
  padding: .4rem .75rem;
  font-size: .85rem;
}
.portal-login-links a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.portal-login-card h2 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.portal-login-submit { width: 100%; text-align: center; margin-top: 1rem; }

.article-cover { margin: 0 0 1rem; border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--border); background: #f8fafc; }
.article-cover img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.article h1 { margin: 1rem 0 0.5rem; color: var(--navy); font-size: 1.75rem; line-height: 1.3; }
.meta-line { font-size: 0.875rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 1rem; }
.excerpt { margin: 1.25rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--blue); background: #f8fafc; color: #334155; }
.article-body { margin-top: 1.25rem; font-size: 1rem; color: #1e293b; line-height: 1.75; }
.article-body--html img { max-width: 100%; height: auto; display: block; margin: 1rem auto; }
.article-body--html p { margin: 0.75rem 0; }
.attachment-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed rgba(26,95,180,.35);
  border-radius: 0.5rem;
  background: #f8fafc;
}
.attachment-box a { font-weight: 600; }

/* 后台图库 */
.media-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.media-tab {
  display: inline-block; padding: 0.35rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem;
  border: 1px solid var(--border); background: #fff; color: #334155;
}
.media-tab:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.media-tab.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem;
}
.media-upload-box { margin-bottom: 1rem; }
.media-upload-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.media-upload-form label { flex: 1 1 260px; font-size: .85rem; font-weight: 600; }
.media-upload-form input[type="file"] { display: block; width: 100%; margin-top: .35rem; }
.media-delete-form { margin-top: .35rem; text-align: center; }
.gallery-admin-grid .media-thumb img { border-radius: .35rem; }
.settings-bg-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .settings-bg-grid { grid-template-columns: repeat(3, 1fr); } }
.settings-bg-card { padding: 1rem; }
.settings-bg-card label { margin-top: .75rem; }
.settings-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem 1rem;
  margin-top: .75rem;
}
.settings-link-grid label { margin-top: 0; }
.settings-bg-card input[type="file"],
.form-grid input[type="file"] { display: block; width: 100%; margin-top: .35rem; }
.settings-bg-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: .5rem;
  margin-top: .75rem;
  background: #f8fafc;
}
.media-card { padding: 0.65rem; }
.media-thumb { border-radius: 0.35rem; overflow: hidden; background: #f1f5f9; }
.media-meta { margin-top: 0.35rem; font-size: 0.7rem; word-break: break-all; }
.media-path { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.65rem; }

.admin-nav {
  width: 14rem; flex-shrink: 0; background: var(--navy); color: #fff; display: flex; flex-direction: column;
}
.admin-nav .brand { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.1); font-weight: 700; }
.admin-nav a {
  display: block; padding: 0.65rem 1rem; color: #e2e8f0; font-size: 0.9rem; border-radius: 0.35rem; margin: 0.15rem 0.5rem;
}
.admin-nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.admin-nav form { margin-top: auto; padding: 0.5rem; border-top: 1px solid rgba(255,255,255,.1); }
.admin-nav button {
  width: 100%; text-align: left; padding: 0.65rem 1rem; background: transparent; border: 0; color: #fcd34d;
  cursor: pointer; font-size: 0.9rem; border-radius: 0.35rem;
}
.admin-nav button:hover { background: rgba(255,255,255,.08); }
.admin-main { flex: 1; padding: 1.5rem; min-width: 0; }
.admin-h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.admin-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1rem; }
.stat .n { font-size: 1.75rem; font-weight: 700; color: var(--navy); }
.stat .l { font-size: 0.85rem; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--card); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th, .admin-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { background: #f8fafc; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; }
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.draft { background: #fef3c7; color: #92400e; }

.form-grid label { display: block; font-size: 0.85rem; font-weight: 500; margin-top: 1rem; }
.form-grid input[type="text"], .form-grid input[type="email"], .form-grid input[type="password"], .form-grid input[type="url"], .form-grid input[type="number"],
.form-grid select, .form-grid textarea {
  width: 100%; margin-top: 0.35rem; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 0.5rem; font: inherit;
}
.form-grid textarea { min-height: 220px; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.form-row { margin-top: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.btn-solid {
  display: inline-block; padding: 0.55rem 1.25rem; background: var(--blue); color: #fff; border: 0; border-radius: 0.5rem;
  font-weight: 600; cursor: pointer; font-size: 0.9rem;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.btn-solid:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(26,95,180,.22); text-decoration: none; }
.btn-solid.danger { background: #b91c1c; }
.btn-link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font: inherit; }
.danger-link { color: #b91c1c; }
.danger-link:hover { color: #7f1d1d; text-decoration: underline; }
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; }
.alert.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.login-box { max-width: 400px; margin: 3rem auto; padding: 2rem; background: var(--card); border-radius: 1rem; border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.login-box h1 { margin: 0 0 0.5rem; font-size: 1.35rem; color: var(--navy); text-align: center; }

@keyframes hero-shine {
  0%, 55% { transform: translateX(-120%); opacity: 0; }
  65% { opacity: .55; }
  100% { transform: translateX(120%); opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .58s ease, transform .58s ease, box-shadow .24s ease, border-color .24s ease;
    transition-delay: var(--reveal-delay, 0ms);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .card.reveal.is-visible:hover,
  .feature-strip .reveal.is-visible:hover,
  .campus-stats .reveal.is-visible:hover {
    transform: translateY(-3px);
  }
  .portal-card.reveal.is-visible:hover {
    transform: translateY(-4px);
  }
  .hero-main h1,
  .hero-main .lead,
  .hero-actions {
    animation: fade-up .62s ease both;
  }
  .hero-main .lead { animation-delay: .12s; }
  .hero-actions { animation-delay: .22s; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gallery-focus {
  from { transform: scale(.98); opacity: .86; }
  to { transform: scale(1.04); opacity: 1; }
}

@media (max-width: 720px) {
  body { background: #f8fafc; }
  .container { padding: 0 .85rem; }
  .site-header {
    background:
      linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.62)),
      var(--mobile-bg-image, var(--header-bg-image, none)) center/100% 100% no-repeat,
      #fff;
  }
  .topbar { font-size: .78rem; }
  .topbar-inner { align-items: flex-start; gap: .35rem; flex-direction: column; padding: .45rem .85rem; }
  .topbar-links { display: flex; gap: .5rem; align-items: center; }
  .header-main { min-height: 190px; padding: 1.25rem .85rem; gap: .75rem; align-items: flex-start; }
  .brand { width: 100%; gap: .6rem; align-items: center; }
  .logo { width: 46px; height: 46px; font-size: 1rem; }
  .logo-img { max-height: 52px !important; max-width: 170px !important; }
  .site-title { font-size: 1.05rem; line-height: 1.25; }
  .site-motto { font-size: .7rem; }
  .site-search { order: 3; width: 100%; }
  .main-nav {
    order: 4;
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: .55rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    font-size: .82rem;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a {
    padding: .35rem .55rem;
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(226,232,240,.9);
  }
  .main-nav a::after { display: none; }
  .main-nav a.is-active { background: #eff6ff; border-color: rgba(26,95,180,.28); }
  .layout { padding: 1rem .85rem; gap: 1rem; }
  .hero {
    min-height: 420px;
    background:
      linear-gradient(180deg, rgba(12,35,64,.82), rgba(12,35,64,.46), rgba(12,35,64,.22)),
      var(--mobile-bg-image, var(--header-bg-image, none)) center/cover no-repeat,
      linear-gradient(135deg, var(--navy), var(--blue));
  }
  .hero-grid { min-height: 420px; }
  .hero-main { padding: 1.35rem; min-height: 260px; justify-content: flex-end; }
  .hero-main h1 { font-size: 1.45rem; }
  .hero-main .lead { font-size: .85rem; }
  .hero-side { margin: .85rem; padding: .85rem 1rem; }
  .feature-strip { margin: .85rem 0 1rem; }
  .campus-stats { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .campus-stats div { padding: .8rem .5rem; }
  .two-col { gap: 1rem; }
  .news-list li { gap: .55rem; padding: .7rem 0; }
  .datebox { width: 2.45rem; }
  .grid-links { grid-template-columns: 1fr; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .portal-card { min-height: 5.7rem; padding: .85rem; }
  .sidebar { display: grid; gap: .75rem; }
  .sidebar .card { margin-bottom: 0; }
  .site-footer {
    background:
      linear-gradient(180deg, rgba(255,255,255,.78), rgba(248,250,252,.66)),
      var(--mobile-bg-image, var(--footer-bg-image, none)) center/100% 100% no-repeat,
      var(--card);
    min-height: 220px;
    padding: 2.25rem .85rem;
  }
}
