:root {
    --primary-red: #c0392b; /* Bright red for accents */
    --footer-red: #7f1f2b;  /* Specified footer color */
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f9f9f9;
    --border-color: #eeeeee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Heiti SC", sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #fff;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background: #fff;
    padding: 15px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    gap: 20px;
    align-items: center;
}

.logo img {
    height: 60px; /* Increased slightly */
    display: block;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-list li {
    position: relative; /* For sub-menu positioning */
}

.nav-list a {
    font-size: 16px;
    font-weight: 500;
    padding-bottom: 5px;
    color: #333;
    position: relative;
    transition: color 0.3s ease;
    display: block; /* Make sure block for hover */
}

/* Sub-menu Styles (PC) */
.sub-nav {
    display: none;
    position: absolute;
    top: calc(100% + 12px); /* Add gap to prevent overlap */
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Softer shadow */
    border-radius: 4px; /* Rounded corners */
    padding: 8px 0;
    z-index: 1000;
    border: 1px solid #f0f0f0; /* Subtle border */
}

/* Invisible bridge to prevent menu closing when moving mouse across gap */
.sub-nav::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.nav-list li:hover .sub-nav {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.sub-nav li a {
    font-size: 14px;
    padding: 10px 20px; /* More breathing room */
    color: #555;
    border-bottom: none;
    white-space: nowrap;
    text-align: center; /* Center align text */
    display: block;
    transition: all 0.2s;
}

.sub-nav li a:hover {
    color: var(--primary-red);
    background-color: #fcfcfc;
}

.sub-nav li a::after {
    display: none; /* No underline for sub-menu */
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}

.nav-list a:hover {
    color: var(--primary-red);
}

.nav-list a:hover::after,
.nav-list a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    display: block;
}

/* Banner & Carousel */
.banner {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 420px; /* Reduced height by 30% from 600px */
}

/* For mobile, allow height to be auto or smaller */
@media (max-width: 768px) {
    .banner {
        height: 300px;
    }
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.carousel-item.active {
    opacity: 1;
    z-index: 2;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-text {
    /* Keep existing styles, just ensure z-index is higher */
    position: absolute;
    top: 30%;
    left: 45%;
    transform: translate(-50%, -50%);
    color: rgb(127, 31, 43);
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
    z-index: 10; /* Above carousel items */
    pointer-events: none; /* Let clicks pass through to arrows if we had them */
}

/* Controls (Arrows) */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5); /* White semi-transparent */
    font-size: 40px;
    cursor: pointer;
    z-index: 20; /* Ensure above everything */
    padding: 10px 20px;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.carousel-control:hover {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(0, 0, 0, 0.1); /* Slight background on hover for visibility */
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

.banner-text h1 {
    font-size: 48px;
    margin-bottom: 10px;
    color: rgb(127, 31, 43);
    font-weight: bold;
}

.banner-text p {
    font-size: 24px;
    color: rgb(127, 31, 43);
}

/* Features (Floating Images) */
.features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: -80px; /* Overlap banner more */
    position: relative;
    z-index: 10;
    margin-bottom: 50px;
}

.feature-link {
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px; /* Optional rounded corners */
    overflow: hidden;
    /* Black gradient-like surround (shadow) */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.feature-link:hover {
    transform: translateY(-4px); /* Reduced amplitude */
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
}

.feature-link img {
    display: block;
    width: auto;
    height: 120px; /* Match previous height or auto */
    max-width: 100%;
    /* If images are just the button graphic, maybe no border radius needed on container unless image has it */
}

/* Main Content Common */
.section-block {
    margin-bottom: 100px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 22px;
    color: #333;
    border-left: 5px solid var(--primary-red);
    padding-left: 10px;
    line-height: 1;
}

.more-link {
    font-size: 14px;
    color: #999;
}

/* School News */
.news-content {
    display: flex;
    gap: 30px;
    align-items: stretch; /* Ensure equal height */
}

.news-image {
    flex: 0 0 45%;
    max-height: 380px; /* Limit height to prevent expanding beyond list */
    overflow: hidden; /* Hide overflow */
    position: relative; /* Context for image */
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Maintain aspect ratio, cover area */
    display: block;
}

.news-list {
    flex: 1;
}

.news-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    font-size: 16px;
}

.news-title {
    position: relative;
    padding-left: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1; /* Allow title to fill available space */
    padding-right: 15px; /* Add space between title and date */
}

.news-title::before {
    content: '●'; /* Bullet point */
    color: #f39c12; /* Orange/Yellow */
    position: absolute;
    left: 0;
    font-size: 10px;
    top: 4px;
}

.news-date {
    color: #999;
    font-size: 13px;
    white-space: nowrap; /* Prevent date from wrapping */
    flex-shrink: 0; /* Prevent date from shrinking */
}

/* Bottom Columns */
.bottom-columns {
    display: flex;
    gap: 30px;
}

.showcase {
    flex: 0 0 42%; /* Slightly smaller width for showcase */
}

.notice {
    flex: 1; /* Takes remaining space, making it wider */
}

/* Showcase Grid */
.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.showcase-item {
    position: relative;
    overflow: hidden;
}

.showcase-item.small {
    height: 160px; /* Fixed height for small items */
}

.showcase-item.big {
    grid-column: 1 / span 2;
    grid-row: 2; /* Ensure it stays at bottom */
    height: 240px; /* Fixed height for big item to align with notice list */
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.showcase-item:hover img {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}

/* Notice List */
.notice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0; /* Increased padding for better line height */
    border-bottom: 1px solid #f5f5f5;
}

.notice-item::before {
    content: '■'; /* Square bullet */
    color: var(--primary-red);
    font-size: 10px;
    margin-right: 8px;
    flex-shrink: 0;
}

.notice-text {
    font-size: 16px;
    color: #444;
    padding-left: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.notice-date {
    font-size: 12px;
    color: #999;
    padding-left: 15px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Footer */
.site-footer {
    background-color: var(--footer-red);
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-top: 50px;
    /* Ensure footer stays at bottom if content is short, though not an issue here */
}

/* Responsive Design */
@media (max-width: 1200px) {
    .banner-text {
        left: 50%; /* Center horizontally */
        top: 40%;  /* Adjust vertical position */
        width: 90%; /* Increase width usage */
        text-align: center; /* Center text content */
    }
}

@media (max-width: 1024px) {
    .header-inner {
        flex-wrap: wrap;
        position: relative;
    }

    .logo img:first-child {
        display: none; /* Hide Logo 1 on tablets/mobile */
    }

    .logo img:last-child {
        height: 50px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: static;
    }

    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 0;
        background: #fff;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top: 1px solid #eee;
    }
    
    .nav-list.open {
        display: flex;
    }

    .nav-list li {
        width: 100%;
        text-align: left;
    }

    .nav-list li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
    }

    .sub-nav {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: #f9f9f9;
        transform: none;
        width: 100%;
        padding: 0;
        min-width: 0;
    }

    .sub-nav::before {
        display: none;
    }

    .nav-list li:hover .sub-nav {
        display: block;
        animation: none;
    }

    .sub-nav li a {
        padding-left: 40px;
        border-bottom: 1px solid #eee;
        text-align: left;
    }
}

@media (max-width: 768px) {
    /* Reuse styles from above where applicable, but specific tweaks for smaller screens */
    .banner {
        height: auto;
        aspect-ratio: 16/9; /* Responsive height based on aspect ratio */
    }

    .banner-text {
        display: none; /* Hide text on mobile */
    }

    .features {
        flex-direction: row;
        margin-top: 20px;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }

    .feature-link {
        width: 45%;
        max-width: 180px;
        display: block;
    }

    .feature-link img {
        width: 100%;
        height: auto;
    }

    .news-content {
        flex-direction: column;
    }

    .bottom-columns {
        flex-direction: column;
    }

    .showcase-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .showcase-item.big {
        grid-column: 1 / span 2;
        grid-row: 2;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 576px) {
    /* Height is handled by aspect-ratio in 768px media query, but we can override if needed. 
       Actually aspect-ratio is better for all mobiles. */
    
    .carousel-control {
        font-size: 30px; /* Smaller arrows */
        padding: 5px 10px;
    }
}