:root {
  --primary-color: #0b4f79;
  --secondary-color: #123247;
  --accent-color: #d8aa2b;
  --accent-soft: #fff4cf;
  --heading-color: #0a456b;
  --text-color: #26323a;
  --muted-color: #6a7780;
  --border-color: #d8e0e6;
  --background-color: #0A3B64;
  --panel-color: #ffffff;
  --side-panel-color: #f5fbff;
  --container-width: 1220px;
  --border-radius: 6px;
  --shadow: 0 6px 18px rgba(16, 43, 62, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: #0A3B64;
  color: var(--text-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(var(--container-width), calc(100% - 28px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: #fff; padding: 8px 12px; }
.skip-link:focus { left: 8px; }

.site-header { background: var(--primary-color); }
.topbar { background: #0a3958; color: #dbeaf2; font-size: 14px; }
.topbar-inner { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; padding: 6px 0; }

.brand-band { background: var(--primary-color); border-bottom: 4px solid var(--accent-color); }
.brand-wrap {
  position: relative;
  min-height: 154px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 72px;
}
.logo { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); }
.logo img { width: 96px; height: 96px; object-fit: contain; border-radius: 50%; background: #fff; padding: 6px; box-shadow: var(--shadow); }
.brand-title { text-align: center; max-width: 860px; }
.brand-title h1 {
  margin: 0 0 6px;
  color: #fff;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.15;
  font-weight: 800;
  text-shadow: 1px 2px 0 rgba(0,0,0,.55);
}
.brand-title p {
  margin: 0;
  color: #ffd44d;
  font-size: clamp(20px, 3vw, 34px);
  line-height: 1.15;
  font-weight: 800;
  text-shadow: 1px 2px 0 rgba(0,0,0,.55);
}
.brand-meta { margin-top: 6px; color: #d8edf7; font-size: 15px; }
.header-banner { display: block; width: 100%; }
.header-banner img { width: 100%; height: 154px; object-fit: contain; background: var(--primary-color); }
.menu-toggle {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 40px;
  border: 0;
  border-radius: var(--border-radius);
  background: var(--accent-color);
  color: #172536;
  font-size: 24px;
  font-weight: 800;
}

.nav-bar { position: sticky; top: 0; z-index: 90; background: var(--secondary-color); box-shadow: 0 4px 12px rgba(0,0,0,.16); }
.nav-wrap { min-height: 50px; display: flex; align-items: stretch; justify-content: center; }
.menu { width: 100%; display: flex; justify-content: center; align-items: stretch; list-style: none; margin: 0; padding: 0; }
.menu > li { position: relative; }
.menu a, .menu button {
  display: block;
  border: 0;
  background: transparent;
  color: #f2f7fb;
  height: 100%;
  padding: 14px 15px;
  font-weight: 600;
  white-space: nowrap;
}
.menu a.active, .menu button.active { background: var(--accent-color); color: #1f2b34; }
.menu li:hover > a, .menu li:hover > button, .menu li.open > button { background: #0b4f79; color: #fff; }
.menu li:hover > a.active, .menu li:hover > button.active { background: var(--accent-color); color: #1f2b34; }
.menu ul {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 120;
  min-width: 230px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-top: 3px solid var(--accent-color);
  box-shadow: var(--shadow);
}
.menu li:hover > ul, .menu li.open > ul { display: block; }
.menu ul li { position: relative; }
.menu ul ul { left: 100%; top: 0; }
.menu ul a, .menu ul button {
  width: 100%;
  color: #26323a;
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid #eef2f5;
}
.menu ul a:hover, .menu ul button:hover { color: var(--primary-color); background: #f2f8fb; }
.site-search { display: none; }

.notice-marquee { background: #fff; border-bottom: 1px solid var(--border-color); }
.notice-marquee-inner { height: 40px; display: flex; align-items: stretch; gap: 0; overflow: hidden; padding: 0; }
.notice-marquee strong {
  align-self: stretch;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding: 0 14px;
  background: #c62828;
  color: #fff;
  white-space: nowrap;
}
.marquee-window { flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; align-items: center; background: #fff; }
.marquee-track { display: inline-flex; gap: 42px; white-space: nowrap; padding-left: 100%; animation: noticeSlide 28s linear infinite; will-change: transform; }
.marquee-track a { color: var(--primary-color); font-weight: 600; }
.marquee-track a::before { content: "■"; color: #d71920; font-size: 9px; margin-right: 8px; }
.notice-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes noticeSlide { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.home-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
  margin-bottom: 18px;
}
.left-col, .content-col, .right-col { min-width: 0; }
.content-col { display: block; }
.home-layout .panel:last-child { margin-bottom: 0; }
.panel {
  background: var(--panel-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 18px;
}
.panel h2, .panel h3 {
  margin: 0 0 12px;
  color: var(--heading-color);
  line-height: 1.3;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 7px;
}

.leader-card { background: #D9B348; border-color: #c59d2f; }
.leader-card.principal-card { background: #D9B348; border-color: #c59d2f; }
.leader-card h3, .leader-card.principal-card h3 { color: #172536; border-bottom-color: rgba(255,255,255,.8); }
.leader-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  border: 4px solid #f1d87b;
  background: #fff;
  margin: 8px 0 10px;
}
.leader-card h4 { margin: 0; color: #172536; }
.muted { color: var(--muted-color); }
.readmore { color: var(--primary-color); font-weight: 700; }

.hero-slider {
  position: relative;
  height: 410px;
  min-height: 0;
  overflow: hidden;
  background: #0b3958;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}
.slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity .75s ease, transform .75s ease;
  z-index: 0;
}
.slide.active { opacity: 1; transform: scale(1); z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: #0b3958; }
.slide::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(0,0,0,.56), transparent);
}
.slide-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 2;
  color: #fff;
  display: none;
}
.slide-caption h2 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 36px); line-height: 1.2; }
.slide-caption p { margin: 0 0 10px; max-width: 620px; }
.slider-prev, .slider-next {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 38px;
  height: 52px;
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(0,0,0,.28);
  color: #fff;
  font-size: 34px;
}
.slider-prev { left: 10px; }
.slider-next { right: 10px; }
.slider-dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 5; text-align: center; }
.slider-dots button {
  width: 12px;
  height: 12px;
  margin: 0 4px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
}
.slider-dots button.active { background: var(--accent-color); }

.welcome { background: #fff; }
.welcome h2 { font-size: clamp(24px, 3vw, 34px); text-align: center; border-bottom: 0; color: var(--heading-color); }
.welcome p { font-size: 17px; text-align: left; }
.photo-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.photo-strip a { flex: 0 0 178px; color: var(--text-color); }
.photo-strip img { width: 178px; height: 112px; object-fit: contain; border-radius: var(--border-radius); background: #dbe5eb; }
.photo-strip span { display: block; margin-top: 5px; font-size: 14px; }

.notice-board article, .notice-list article, .download-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f4;
}
.notice-board article { display: block; }
.notice-board article a, .notice-list h3 a { color: var(--primary-color); font-weight: 700; }
.notice-board small, .notice-list p, .download-list small { display: block; color: var(--muted-color); }
.notice-icon { color: #d71920; font-size: 9px; }
.new, .notice-board b { display: inline-block; padding: 1px 6px; border-radius: 999px; background: #d71920; color: #fff; font-size: 12px; }
.blue-panel { background: var(--side-panel-color); }
.edu-links-panel { max-height: 520px; overflow-y: auto; background: #f8fcff; }
.edu-links-panel a { font-size: 15px; }
.link-list a {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px dashed #d7e2e9;
  color: #31566d;
}
.link-list a:hover { color: var(--primary-color); padding-left: 4px; }

.btn, .button, button.btn {
  display: inline-block;
  border: 0;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: #fff;
  padding: 9px 14px;
  font-weight: 700;
}
.btn.ghost, .button.ghost { background: #eef4f8; color: var(--primary-color); }
.btn.small { padding: 5px 10px; font-size: 14px; }
.btn.full { display: block; text-align: center; margin-top: 12px; }

.page-hero { background: var(--primary-color); color: #fff; padding: 24px 0; margin-bottom: 18px; border-top: 3px solid var(--accent-color); }
.page-hero h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); }
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; color: #dcecf5; font-size: 14px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.prose { background: #fff; }
.prose h1 { color: var(--heading-color); }
.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.filters input, .filters select, .stack-form input, .stack-form textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 10px;
  background: #fff;
}
.profile-grid, .gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.profile-card, .gallery-grid a {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.profile-card img { width: 100%; height: 190px; object-fit: contain; border-radius: var(--border-radius); background: #fff; }
.profile-card h3 { margin: 10px 0 2px; color: var(--heading-color); }
.profile-card p, .profile-card small { margin: 0; color: var(--muted-color); }
.profile-detail { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; background: #fff; }
.profile-detail > img { width: 260px; height: 310px; object-fit: contain; border-radius: var(--border-radius); background: #fff; }
.gallery-grid img { width: 100%; height: 170px; object-fit: contain; border-radius: var(--border-radius); background: #eef2f5; }
.table-wrap { overflow-x: auto; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #dde5ea; padding: 9px; text-align: left; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; }
.contact-grid iframe, .map-panel iframe { width: 100%; min-height: 260px; border: 0; border-radius: var(--border-radius); }
.map-panel { margin-bottom: 0; }
.stack-form { display: grid; gap: 10px; }
.hp { display: none; }
.success { background: #e8f8ef; color: #116032; padding: 10px; border-radius: var(--border-radius); }
.error { background: #fdecec; color: #8f1b1b; padding: 10px; border-radius: var(--border-radius); }
.empty { color: var(--muted-color); text-align: center; padding: 22px; }
.pagination a { display: inline-block; margin: 8px 3px 0; padding: 5px 10px; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: #fff; }
.pagination .active { background: var(--primary-color); color: #fff; }

.map-gap-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--border-radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.map-gap-nav a {
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 10px 8px;
  border-right: 1px solid rgba(10,59,100,.14);
  border-bottom: 1px solid rgba(10,59,100,.14);
  background: #f7fbfd;
  color: #0a4f79;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}
.map-gap-nav a:nth-child(4n),
.map-gap-nav a:last-child { border-right: 0; }
.map-gap-nav a:nth-last-child(-n+4) { border-bottom: 0; }
.map-gap-nav a:hover { background: var(--accent-color); color: #172536; }

.site-footer { margin-top: 0; background: #123247; color: #dce8ef; }
.footer-grid { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 20px; padding: 30px 0; }
.footer-grid h3 { margin: 0 0 10px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.24); padding-bottom: 7px; }
.footer-grid a { display: block; padding: 3px 0; color: #dce8ef; }
.footer-bottom { background: #0b2231; padding: 11px 0; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.social a { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 6px; border-radius: 50%; background: var(--accent-color); color: #162331; font-weight: 800; }
.back-top { position: fixed; right: 14px; bottom: 14px; z-index: 80; display: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary-color); color: #fff; }
.back-top.show { display: block; }

@media (max-width: 1100px) {
  .menu a, .menu button { padding-left: 10px; padding-right: 10px; font-size: 15px; }
  .home-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .right-col { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .right-col .panel { margin-bottom: 0; }
  .map-gap-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .container { width: min(100% - 18px, var(--container-width)); }
  .topbar { display: none; }
  .brand-wrap { justify-content: flex-start; min-height: 92px; padding: 12px 58px 12px 12px; }
  .logo { position: static; transform: none; flex: 0 0 auto; }
  .logo img { width: 66px; height: 66px; }
  .brand-title { text-align: left; }
  .brand-title h1 { font-size: 21px; text-shadow: 1px 1px 0 rgba(0,0,0,.55); }
  .brand-title p { font-size: 15px; }
  .brand-meta { display: none; }
  .header-banner img { height: 96px; object-fit: contain; }
  .menu-toggle { display: block; }
  .nav-wrap { display: block; min-height: 0; }
  .menu { display: none; flex-direction: column; align-items: stretch; background: var(--secondary-color); }
  .menu.open { display: flex; }
  .menu a, .menu button { width: 100%; text-align: left; padding: 12px 14px; }
  .menu ul, .menu ul ul { position: static; min-width: 0; box-shadow: none; border-top: 0; background: #eef5f8; }
  .menu li:hover > ul { display: none; }
  .menu li.open > ul { display: block; }
  .menu ul a, .menu ul button { padding-left: 28px; }
  .notice-marquee-inner { width: 100%; height: 36px; padding: 0; }
  .notice-marquee strong { padding: 0 9px; font-size: 13px; }
  .marquee-track { gap: 30px; animation-duration: 18s; padding-left: 100%; }
  .home-layout { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
  .content-col { display: block; order: 1; width: 100%; }
  .right-col { order: 2; display: block; width: 100%; }
  .left-col { order: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
  .hero-slider { height: 300px; }
  .slide-caption { left: 18px; right: 18px; bottom: 24px; }
  .slide-caption p { display: none; }
  .two-col, .contact-grid, .profile-detail { display: block; }
  .two-col > aside { margin-top: 12px; }
  .profile-detail > img { width: 100%; height: auto; max-height: 360px; margin-bottom: 14px; }
  .profile-grid, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .map-gap-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
  .map-gap-nav a:nth-child(4n) { border-right: 1px solid rgba(10,59,100,.14); }
  .map-gap-nav a:nth-child(2n) { border-right: 0; }
  .map-gap-nav a:nth-last-child(-n+4) { border-bottom: 1px solid rgba(10,59,100,.14); }
  .map-gap-nav a:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .container { width: 100%; padding-left: 8px; padding-right: 8px; }
  .brand-wrap { min-height: 82px; }
  .logo img { width: 56px; height: 56px; }
  .brand-title h1 { font-size: 18px; }
  .brand-title p { font-size: 13px; }
  .menu-toggle { right: 8px; width: 40px; height: 38px; font-size: 23px; }
  .notice-marquee strong { max-width: 116px; }
  .hero-slider { height: 230px; border-radius: 0; }
  .slide-caption h2 { font-size: 20px; }
  .slider-prev, .slider-next { width: 30px; height: 42px; font-size: 28px; }
  .slider-dots button { width: 10px; height: 10px; }
  .panel { padding: 13px; margin-bottom: 12px; border-radius: 0; }
  .left-col { display: block; }
  .welcome h2 { font-size: 21px; }
  .welcome p { font-size: 15px; }
  .profile-grid, .gallery-grid { grid-template-columns: 1fr; }
  .notice-board article, .notice-list article, .download-list article { display: block; }
  .filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom .container { display: block; text-align: center; }
  .page-hero { padding: 16px 0; }
  .map-gap-nav { width: 100%; padding-left: 0; padding-right: 0; }
  .map-gap-nav a { min-height: 56px; font-size: 14px; }
}

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