/* ==============================================
   BASE RESET
   ============================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Heiti TC', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
    vertical-align: middle;
    display: block;
}

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

button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */
.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
   ============================================== */
.site-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ==============================================
   NAVBAR
   ============================================== */
.navbar {
    background-color: #427096;
    color: white;
}

.navbar-container {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 0 3%;
    min-height: 64px;
}

.logo {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    text-decoration: none;
    color: white;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.logo img {
    height: 52px;
    width: auto;
}

/* --- Nav Links --- */
.nav-links {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    list-style: none;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    -ms-flex-pack: center;
    justify-content: center;
    margin: 0 12px;
    overflow: visible;
}

.nav-links li {
    position: relative;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 20px 10px;
    display: block;
    white-space: nowrap;
    position: relative;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: white;
    -webkit-transition: width 0.25s ease;
    transition: width 0.25s ease;
}

.nav-links li a:hover::after,
.nav-links li.active > a::after {
    width: 100%;
}

.nav-links li a:hover,
.nav-links li.active > a {
    background: rgba(255, 255, 255, 0.15);
}

/* --- Dropdown --- */
.nav-links li.has-dropdown {
    position: relative;
}

.nav-links .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: #2e5470;
    list-style: none;
    z-index: 900;
    -webkit-box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(6px);
    -ms-transform: translateY(6px);
    transform: translateY(6px);
    -webkit-transition: opacity 0.2s ease, -webkit-transform 0.2s ease, visibility 0.2s;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.nav-links li.has-dropdown:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

.nav-links .dropdown li a {
    padding: 11px 16px;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-links .dropdown li a::after {
    display: none;
}

.nav-links .dropdown li:last-child a {
    border-bottom: none;
}

/* --- 三層選單 --- */
.nav-links .dropdown li.has-subdropdown {
    position: relative;
}

.nav-links .dropdown li.has-subdropdown > a::after {
    content: '›';
    position: absolute;
    right: 12px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: none;
    font-size: 14px;
    opacity: 0.7;
    -webkit-transition: opacity 0.2s;
    transition: opacity 0.2s;
}

.nav-links .subdropdown {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 140px;
    background: #1e3f55;
    list-style: none;
    z-index: 901;
    -webkit-box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateX(4px);
    -ms-transform: translateX(4px);
    transform: translateX(4px);
    -webkit-transition: opacity 0.18s ease, -webkit-transform 0.18s ease, visibility 0.18s;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.nav-links .dropdown li.has-subdropdown:hover > .subdropdown {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}

.nav-links .subdropdown li a {
    padding: 11px 16px;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: block;
    color: white;
    text-decoration: none;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
}

.nav-links .subdropdown li:last-child a {
    border-bottom: none;
}

.nav-links .subdropdown li a:hover {
    background: rgba(255,255,255,0.12);
}

/* --- Mega Menu（三欄） --- */
.nav-links .dropdown.megamenu {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 1fr 1fr;
    grid-template-columns: repeat(3, 1fr);
    min-width: 390px;
}

.nav-links .dropdown.megamenu li {
    border-right: 1px solid rgba(255,255,255,0.06);
}

.nav-links .dropdown.megamenu li:nth-child(3n) {
    border-right: none;
}

.nav-links .dropdown.megamenu li a {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* --- Nav Right --- */
.nav-right {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    /* gap fallback for older Safari */
    margin-left: 0;
}

.nav-right > * + * {
    margin-left: 10px;
}

.nav-btn--school {
    color: white;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    white-space: nowrap;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
    display: inline-block;
}

.nav-btn--school:hover {
    background: rgba(255,255,255,0.15);
    border-color: white;
}

.nav-btn--admin {
    color: white;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 4px;
    white-space: nowrap;
    -webkit-transition: background 0.2s, border-color 0.2s;
    transition: background 0.2s, border-color 0.2s;
    display: inline-block;
}

.nav-btn--admin:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
}

.nav-mail {
    width: 28px;
    height: 28px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: white;
    opacity: 0.9;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.nav-mail svg {
    width: 22px;
    height: 22px;
}

.nav-lang {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    font-size: 13px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.nav-lang > * + * {
    margin-left: 6px;
}

.nav-lang a {
    color: white;
    text-decoration: none;
}

.nav-lang .active {
    font-weight: bold;
}

.nav-lang span {
    opacity: 0.6;
}

/* --- Hamburger --- */
.nav-toggle {
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    margin: 3px 0;
}

.nav-toggle.active span:nth-child(1) {
    -webkit-transform: translateY(8px) rotate(45deg);
    -ms-transform: translateY(8px) rotate(45deg);
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    -webkit-transform: translateY(-8px) rotate(-45deg);
    -ms-transform: translateY(-8px) rotate(-45deg);
    transform: translateY(-8px) rotate(-45deg);
}

/* ==============================================
   HERO
   ============================================== */
.hero {
    position: relative;
    height: 420px;
    min-height: 160px;
    overflow: hidden;
    background: #7a9ab5;
}

.swiper-container {
    width: 100%;
    height: 100%;
    -ms-touch-action: pan-y;
    touch-action: pan-y;
}

.swiper-wrapper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.hero-img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
    display: block;
    /* IE11 fallback */
    font-family: 'object-fit: cover; object-position: center;';
}

.swiper-pagination {
    position: absolute;
    bottom: 16px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 10;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    display: inline-block;
    margin: 0 4px;
    cursor: pointer;
}

.swiper-pagination-bullet-active {
    background: white;
}

/* ==============================================
   ABOUT
   ============================================== */
.about {
    background: white;
    padding: 70px 5%;
}

.about-inner {
    max-width: 700px;
    margin: 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 30px;
}

/* gap fallback */
.about-inner > * + * {
    margin-left: 30px;
}

.about-seal {
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.about-seal img {
    width: 140px;
    border: 1px solid #427096;
    border-radius: 50%;
}

.about-content h2 {
    font-size: 18px;
    color: #31719a;
    margin-bottom: 8px;
    font-weight: bold;
    border-bottom: 2px solid #31719a;
    padding-bottom: 8px;
}

.about-content h2 span {
    font-size: 15px;
    color: #31719a;
    font-weight: normal;
    margin-left: 8px;
}

.about-content p,
.about-content .home-intro,
.about-content .home-intro p {
    font-size: 14px;
    color: #31719a;
    line-height: 1.8;
    font-weight: bold;
}

.about-content .home-intro p {
    margin-bottom: 0.3em;
}

.about-content .home-intro p:last-child {
    margin-bottom: 0;
}

/* ==============================================
   MODULES
   ============================================== */
.modules {
    background-color: #427096;
    padding: 60px 5%;
}

.modules-container {
    max-width: 900px;
    margin: 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: space-evenly;
    -ms-flex-pack: space-evenly;
    justify-content: space-evenly;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 20px;
}

.module {
    text-align: center;
    color: white;
    -webkit-transition: -webkit-transform 0.2s;
    transition: -webkit-transform 0.2s;
    transition: transform 0.2s;
    transition: transform 0.2s, -webkit-transform 0.2s;
}

.module:hover {
    -webkit-transform: translateY(-4px);
    -ms-transform: translateY(-4px);
    transform: translateY(-4px);
}

.module-link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: white;
    text-decoration: none;
}

.module-link:hover .module-icon svg,
.module-link:focus-visible .module-icon svg {
    opacity: 0.85;
}

.module-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.module-icon svg {
    width: 80px;
    height: 80px;
}

.module h3 {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #fff;
}

/* ==============================================
   ANNOUNCEMENT TABS
   ============================================== */
.ann-tabs {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* gap fallback */
.ann-tabs > * + * {
    margin-left: 8px;
}

.ann-tab {
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #427096;
    background: #f0f4f8;
    border: 1.5px solid #c8d8e8;
    border-radius: 20px;
    cursor: pointer;
    -webkit-transition: background 0.18s, color 0.18s, border-color 0.18s;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    font-family: inherit;
    line-height: 1.5;
    white-space: nowrap;
}

.ann-tab:hover {
    background: #dce8f4;
    border-color: #427096;
}

.ann-tab.active {
    background: #004c99;
    color: #fff;
    border-color: #004c99;
    font-weight: 700;
}

.ann-tab.ord.active    { background: #427096; border-color: #427096; }
.ann-tab.tech.active   { background: #2e7d32; border-color: #2e7d32; }
.ann-tab.alumni.active { background: #b84c00; border-color: #b84c00; }
.ann-tab.incub.active  { background: #6a1b9a; border-color: #6a1b9a; }

/* ==============================================
   DEPT BADGE
   ============================================== */
.badge-dept {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 3px;
    color: #fff;
    margin-right: 6px;
    vertical-align: middle;
    white-space: nowrap;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.badge-dept.ord    { background: #427096; }
.badge-dept.tech   { background: #2e7d32; }
.badge-dept.alumni { background: #b84c00; }
.badge-dept.incub  { background: #6a1b9a; }

/* ==============================================
   ANNOUNCEMENTS
   ============================================== */
.announcements-wrapper {
    background: white;
    padding: 70px 5%;
}

.announcements-container {
    max-width: 1100px;
    margin: 0 auto;
}

.announcement-section {
    width: 100%;
}

.section-heading {
    text-align: center;
    margin-bottom: 32px;
}

.section-heading h2 {
    font-size: 17px;
    color: #333;
    font-weight: bold;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 10px;
}

.section-heading h2::before,
.section-heading h2::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #004c99;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.section-heading .en-title {
    font-size: 13px;
    color: #888;
    font-weight: normal;
}

.announcement-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #ddd;
}

.announcement-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 11px 4px;
    border-bottom: 1px solid #eee;
    gap: 8px;
    min-width: 0;
}

.badge-new {
    background: #e63e3e;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ann-date {
    font-size: 13px;
    color: #004c99;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 38px;
    text-align: center;
    font-weight: bold;
}

.ann-separator {
    color: #ccc;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.ann-text {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

.ann-text a {
    color: #004c99;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    display: block;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-transition: color 0.15s;
    transition: color 0.15s;
}

.ann-text a:hover {
    color: #427096;
    text-decoration: underline;
}

.view-more-wrap {
    text-align: center;
    margin-top: 32px;
}

.btn-more {
    display: inline-block;
    padding: 8px 28px;
    border: 1.5px solid #004c99;
    color: #004c99;
    text-decoration: none;
    font-size: 13px;
    border-radius: 20px;
    -webkit-transition: background 0.2s, color 0.2s;
    transition: background 0.2s, color 0.2s;
}

.btn-more:hover,
.btn-more:focus {
    background: #004c99;
    color: white;
    outline: none;
}

/* ==============================================
   SCHOOL WRAPPER
   ============================================== */
.School-wrapper {
    background: #427096;
    color: #fff;
    padding: 70px 5%;
}

.School-wrapper .section-heading h2 {
    color: #fff;
}

.School-wrapper .section-heading h2::before,
.School-wrapper .section-heading h2::after {
    background: #fff;
}

.School-wrapper .section-heading {
    margin-bottom: 32px;
}

.School-wrapper .section-heading .en-title {
    color: rgba(255,255,255,0.8);
}

.School-wrapper .ann-date {
    color: #fff;
}

.School-wrapper .ann-text a {
    color: #fff;
}

.School-wrapper .view-more-wrap .btn-more {
    border-color: #fff;
    color: #fff;
}

.School-wrapper .view-more-wrap .btn-more:hover {
    background: #fff;
    color: #427096;
}

/* ==============================================
   POPULAR LINKS
   ============================================== */
.popular-links {
    padding: 60px 5%;
    border-top: 1px solid #eee;
}

.popular-links .section-heading {
    margin-bottom: 40px;
}

.links-swiper {
    max-width: 1000px;
    margin: 0 auto;
    -ms-touch-action: pan-y;
    touch-action: pan-y;
    overscroll-behavior-x: contain;
}

.links-swiper .swiper-slide {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.links-swiper .swiper-slide a {
    display: block;
}

.links-swiper .swiper-slide img {
    width: 100%;
    height: auto;
    -webkit-transition: opacity 0.2s;
    transition: opacity 0.2s;
}

.links-swiper .swiper-slide img:hover {
    opacity: 0.85;
}

.links-pagination {
    position: relative;
    margin-top: 24px;
    text-align: center;
}

.links-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(0, 76, 153, 0.4);
    border-radius: 50%;
    display: inline-block;
    margin: 0 4px;
    cursor: pointer;
}

.links-pagination .swiper-pagination-bullet-active {
    background: #004c99;
}

/* ==============================================
   FOOTER
   ============================================== */
.footer {
    background-color: #427096;
    color: white;
    padding: 40px 5% 0;
}

.footer-main {
    max-width: 1000px;
    margin: 0 auto;
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr auto 1fr;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 24px;
}

.footer-links-col {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding-top: 24px;
}

.footer-links-col a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    -webkit-transition: text-decoration 0.15s;
    transition: text-decoration 0.15s;
}

.footer-links-col a:hover {
    text-decoration: underline;
}

.footer-center {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.footer-bottom {
    padding: 16px 5% 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-contact-inner {
    font-style: normal;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 13px;
}

.footer-contact-inner span {
    opacity: 0.9;
}

.footer-contact-inner a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

.footer-contact-inner a:hover {
    text-decoration: underline;
}

.footer-copyright-text {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* ==============================================
   RESPONSIVE: TABLET (768px ~ 1200px)
   ============================================== */
@media (max-width: 1200px) {
    .nav-links li a {
        font-size: 13px;
        padding: 20px 8px;
    }

    .hero {
        height: 340px;
    }
}

@media (max-width: 1024px) {
    /* 平板：漢堡選單 */
    .navbar-container {
        padding: 0 4%;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        min-height: 56px;
    }

    .logo {
        -webkit-box-ordinal-group: 2;
        -ms-flex-order: 1;
        order: 1;
    }

    .nav-right {
        -webkit-box-ordinal-group: 3;
        -ms-flex-order: 2;
        order: 2;
    }

    .nav-toggle {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-ordinal-group: 4;
        -ms-flex-order: 3;
        order: 3;
    }

    .nav-btn--school,
    .nav-btn--admin {
        display: none;
    }

    .nav-links {
        display: none;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-flex: 0;
        -ms-flex: none;
        flex: none;
        width: 100%;
        -webkit-box-ordinal-group: 5;
        -ms-flex-order: 4;
        order: 4;
        background: #427096;
        margin: 0;
        padding: 0;
    }

    .nav-links.open {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        padding: 13px 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
        font-size: 15px;
    }

    .nav-links li a::after {
        display: none;
    }

    /* Mobile/Tablet Dropdown */
    .nav-links .dropdown,
    .nav-links .dropdown.megamenu {
        position: static;
        -webkit-box-shadow: none;
        box-shadow: none;
        background: rgba(0,0,0,0.15);
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
        -webkit-transition: opacity 0.2s ease, max-height 0.25s ease, visibility 0.2s;
        transition: opacity 0.2s ease, max-height 0.25s ease, visibility 0.2s;
        display: block;
        min-width: unset;
        grid-template-columns: unset;
    }

    .nav-links li.has-dropdown.open > .dropdown {
        opacity: 1;
        visibility: visible;
        max-height: 800px;
    }

    .nav-links .dropdown li a {
        padding: 11px 20px 11px 36px;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    /* Mobile 三層 */
    .nav-links .subdropdown {
        position: static;
        -webkit-box-shadow: none;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
        -webkit-transition: opacity 0.2s ease, max-height 0.25s ease, visibility 0.2s;
        transition: opacity 0.2s ease, max-height 0.25s ease, visibility 0.2s;
    }

    .nav-links .dropdown li.has-subdropdown.open > .subdropdown {
        opacity: 1;
        visibility: visible;
        max-height: 400px;
    }

    .nav-links .subdropdown li a {
        padding: 10px 20px 10px 52px;
        font-size: 13px;
    }

    .nav-links .dropdown li.has-subdropdown > a::after {
        content: '＋';
        position: static;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
        float: right;
        font-size: 14px;
    }

    .nav-links .dropdown li.has-subdropdown.open > a::after {
        content: '－';
    }

    .nav-links .dropdown.megamenu li:nth-child(3n) {
        border-right: none;
    }

    /* Hero */
    .hero {
        height: 280px;
    }

    /* Modules */
    .modules-container {
        max-width: 600px;
        gap: 24px;
    }

    /* Footer */
    .footer-main {
        gap: 20px;
    }
}

/* ==============================================
   RESPONSIVE: MOBILE (< 768px)
   ============================================== */
@media (max-width: 767px) {
    /* Hero */
    .hero {
        height: 200px;
    }

    /* About */
    .about {
        padding: 48px 5%;
    }

    .about-inner {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        text-align: center;
        gap: 16px;
        max-width: 100%;
    }

    .about-inner > * + * {
        margin-left: 0;
        margin-top: 16px;
    }

    .about-seal img {
        width: 100px;
        margin: 0 auto;
    }

    /* Modules */
    .modules {
        padding: 40px 5%;
    }

    .modules-container {
        gap: 24px;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }

    .module {
        width: calc(50% - 16px);
    }

    .module-icon {
        width: 72px;
        height: 72px;
    }

    .module-icon svg {
        width: 64px;
        height: 64px;
    }

    .module h3 {
        font-size: 14px;
    }

    /* Announcements */
    .announcements-wrapper {
        padding: 48px 4%;
    }

    .School-wrapper {
        padding: 48px 4%;
    }

    .ann-text a {
        font-size: 13px;
        white-space: normal;
        overflow: visible;
        -o-text-overflow: unset;
        text-overflow: unset;
    }

    /* Popular links */
    .popular-links {
        padding: 40px 4%;
    }

    /* Footer */
    .footer {
        padding: 32px 5% 0;
    }

    .footer-main {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
        text-align: center;
        gap: 12px;
    }

    .footer-center {
        -webkit-box-ordinal-group: 0;
        -ms-flex-order: -1;
        order: -1;
    }

    .footer-center img {
        height: 100px !important;
    }

    .footer-links-col {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        gap: 6px 16px;
        padding-top: 0;
    }

    .footer-contact-inner {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .footer-copyright-text {
        font-size: 12px;
    }
}

/* ==============================================
   RESPONSIVE: SMALL MOBILE (< 480px)
   ============================================== */
@media (max-width: 479px) {
    .logo img {
        height: 42px;
    }

    .hero {
        height: 160px;
    }

    .about {
        padding: 36px 4%;
    }

    .module {
        width: calc(50% - 12px);
    }

    .ann-tabs {
        gap: 6px;
    }

    .ann-tab {
        padding: 5px 12px;
        font-size: 12px;
    }

    .badge-dept {
        font-size: 10px;
        padding: 1px 5px;
    }
}

/* ==============================================
   REDUCED MOTION
   ============================================== */
@media (prefers-reduced-motion: reduce) {
    .swiper-wrapper {
        -webkit-transition-duration: 0ms !important;
        transition-duration: 0ms !important;
    }

    .swiper-container-fade .swiper-slide {
        -webkit-transition-duration: 0ms !important;
        transition-duration: 0ms !important;
    }

    .module {
        -webkit-transition: none;
        transition: none;
    }

    .nav-links .dropdown {
        -webkit-transition: none;
        transition: none;
    }
}
