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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Microsoft YaHei', '微软雅黑', sans-serif;
    line-height: 1.6;
    color: #333;
}

.chinese {
    display: block;
    font-size: 0.95em;
    margin-bottom: 2px;
}

.english {
    display: block;
    font-size: 1em;
}

/* Navigation Bar */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    position: relative;
}

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

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #347f3e;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.logo-container {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    height: 60px;
    width: auto;
}

.school-name {
    font-family: 'YRDZST', 'STXingkai', 'KaiTi', '楷体', cursive;
    font-size: 34px;
    font-weight: 500;
    color: #347f3e;
    letter-spacing: 3px;
}

/* Responsive school name scaling for tablet/landscape mobile */
@media (max-width: 1024px) and (min-width: 425px) {
    .school-name {
        font-size: 26px;
        letter-spacing: 2px;
    }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-item {
    text-align: center;
}

.nav-link {
    text-decoration: none;
    color: #333;
    padding: 10px 15px;
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-link:hover {
    color: #4CAF50;
    transform: translateY(-2px);
}

.nav-link.active {
    color: #347f3e;
    border-bottom: 2px solid #347f3e;
}

.nav-link .chinese {
    font-size: 14px;
    font-weight: 500;
}

.nav-link .english {
    font-size: 15px;
    font-weight: 400;
}

/* Hero Banner */
.hero-banner {
    margin-top: 90px;
    position: relative;
    height: 600px;
    overflow: hidden;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.banner-left {
    flex: 0 0 auto;
}

.banner-logo {
    height: 420px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.banner-right {
    flex: 1;
    text-align: right;
    padding-left: 60px;
}

.banner-text {
    margin-bottom: 30px;
}

.banner-text .chinese {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.banner-text .english {
    font-size: 19px;
    line-height: 1.6;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.explore-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 22px 50px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    margin-top: 15px;
}

.explore-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.explore-btn .chinese {
    font-size: 17px;
    margin-bottom: 3px;
}

.explore-btn .english {
    font-size: 18px;
}

/* Content Sections */
.content-section {
    padding: 80px 0;
}

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

/* Segment Styles */
.segment-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.segment-green {
    background: linear-gradient(135deg, #e8f5e8 0%, #d4e9d4 100%);
}

.segment-white {
    background: #ffffff;
}

.segment-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 120px;
}

.segment-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 500px;
}

.segment-content.reverse {
    grid-template-columns: 1fr 1.2fr;
}

.segment-text h2 {
    margin-bottom: 30px;
    color: #347f3e;
}

.segment-text h2 .chinese {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: bold;
}

.segment-text h2 .english {
    font-size: 28px;
    font-weight: 600;
}

.segment-text p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 20px;
    text-align: left;
}

.segment-text p.chinese {
    color: #333;
    font-weight: 500;
}

.segment-text p.english {
    color: #555;
}

.segment-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 100%;
    height: 350px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #ccc;
    transition: all 0.3s ease;
}

.image-placeholder:hover {
    border-color: #347f3e;
    background: linear-gradient(45deg, #f5f5f5, #e5e5e5);
}

.placeholder-text {
    text-align: center;
    font-size: 16px;
    color: #666;
    font-weight: 500;
    line-height: 1.4;
}

.segment-photo {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.segment-photo:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        height: 70px;
        padding: 0 15px;
    }

    .segment-container {
        padding: 0 40px;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .segment-container {
        padding: 0 60px;
    }

    .segment-photo {
        height: 350px;
    }
}

/* Additional tablet portrait mode */
@media (max-width: 768px) and (min-width: 481px) {
    .segment-photo {
        height: 300px;
    }
}

/* Tablet and Mobile adjustments */
@media (max-width: 1024px) {
    .segment-content {
        grid-template-columns: 1fr;
        gap: 40px;
        min-height: auto;
    }

    .segment-content.reverse {
        grid-template-columns: 1fr;
    }

    .segment-content.reverse .segment-image {
        order: 1;
    }

    .segment-content.reverse .segment-text {
        order: 2;
    }

    .segment-text h2 .chinese {
        font-size: 28px;
    }

    .segment-text h2 .english {
        font-size: 24px;
    }

    .segment-text p {
        font-size: 16px;
    }

    .image-placeholder {
        height: 250px;
    }

    .segment-photo {
        height: 450px;
    }

    .logo-container {
        padding: 10px 0;
        gap: 10px;
    }

    .nav-logo {
        height: 40px;
    }


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

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
        width: 100%;
        text-align: left;
    }

    .nav-link .chinese {
        font-size: 16px;
        margin-bottom: 2px;
    }

    .nav-link .english {
        font-size: 14px;
        color: #666;
    }

    .hero-banner {
        margin-top: 70px;
        height: 400px;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
        padding: 0 20px;
        gap: 5px;
    }

    .banner-right {
        padding-left: 0;
        padding-top: 0;
        text-align: center;
    }

    .banner-logo {
        height: 200px;
        margin: 0;
    }

    .banner-text {
        display: none;
    }

    .banner-title {
        font-size: 24px;
    }

    .banner-subtitle {
        font-size: 16px;
    }

    .explore-btn {
        padding: 8px 20px;
        font-size: 13px;
    }

    .explore-btn .chinese {
        font-size: 12px;
    }

    .explore-btn .english {
        font-size: 13px;
    }

    /* Mobile adjustments for course review pages */
    .reviews-main {
        margin-top: 70px !important;
        padding: 20px 15px;
    }

    .reviews-header {
        margin-bottom: 30px;
    }

    .course-banner {
        max-width: 280px;
        margin: 0 auto 20px;
    }

    .reviews-title {
        font-size: 28px;
    }

    .reviews-container {
        padding: 25px 20px;
    }

    .review-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .review-card {
        padding: 20px;
    }

    .review-title {
        font-size: 18px;
    }

    .vocabulary-section, .sentences-section {
        padding: 12px;
        margin: 12px 0;
    }

    .vocabulary-section h4, .sentences-section h4 {
        font-size: 15px;
    }

    .vocabulary-section p, .sentences-section p {
        font-size: 14px;
    }

    .review-link {
        padding: 8px 18px;
        font-size: 13px;
    }

    .back-btn {
        padding: 10px 20px;
        font-size: 14px;
        margin-bottom: 20px;
    }

    /* Mobile adjustments for courses page */
    .courses-main {
        margin-top: 70px !important;
        padding: 20px 15px;
    }

    .courses-header {
        margin-bottom: 30px;
    }

    .courses-title .chinese {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .courses-title .english {
        font-size: 32px;
    }

    .grade-section {
        margin-bottom: 40px;
        padding: 25px 20px;
    }

    .grade-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .course-card {
        margin: 0 auto;
        max-width: 350px;
    }

    .course-image {
        height: 150px;
    }

    .course-content {
        padding: 20px;
    }

    .course-name {
        font-size: 20px;
    }

    .course-description {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .access-btn {
        padding: 10px 25px;
        font-size: 14px;
    }

    /* Mobile adjustments for gallery page */
    .gallery-main {
        margin-top: 70px !important;
        padding: 20px 15px;
    }

    .gallery-header {
        margin-bottom: 30px;
    }

    .gallery-title {
        font-size: 28px;
    }

    .gallery-container {
        columns: 2;
        column-gap: 10px;
    }

    .gallery-image {
        margin-bottom: 10px;
    }

    /* Mobile adjustments for contact page */
    main[style*="margin-top: 90px"] {
        margin-top: 70px !important;
    }
}

/* Small mobile devices (376px to 424px) */
@media (max-width: 424px) and (min-width: 376px) {
    .school-name {
        font-size: 18px;
        letter-spacing: 1px;
    }
}

/* Extra small mobile devices (320px and below) */
@media (max-width: 375px) {
    .nav-container {
        height: 60px;
        padding: 0 10px;
    }

    .hero-banner {
        margin-top: 60px;
        height: 350px;
    }

    .banner-content {
        padding: 0 15px;
        width: 95%;
    }

    .banner-logo {
        height: 180px;
        margin: 0;
    }

    .banner-text {
        display: none;
    }

    .logo-container {
        padding: 5px 0;
        gap: 8px;
    }

    .nav-logo {
        height: 30px;
    }

    .school-name {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
    }

    .hero-banner {
        margin-top: 60px;
        height: 300px;
    }

    .banner-title {
        font-size: 20px;
    }

    .banner-subtitle {
        font-size: 14px;
    }

    .banner-logo {
        height: 160px;
        margin: 0;
    }

    .explore-btn {
        padding: 6px 15px;
        font-size: 11px;
    }

    .explore-btn .chinese {
        font-size: 10px;
    }

    .explore-btn .english {
        font-size: 11px;
    }

    /* Reviews page adjustments */
    .reviews-main {
        margin-top: 60px !important;
        padding: 15px 10px;
    }

    .course-banner {
        max-width: 200px;
        margin: 0 auto 15px;
    }

    .reviews-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .reviews-header p {
        font-size: 14px !important;
    }

    .reviews-container {
        padding: 20px 15px;
    }

    .review-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .review-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .vocabulary-section, .sentences-section {
        padding: 10px;
        margin: 10px 0;
    }

    .vocabulary-section h4, .sentences-section h4 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .vocabulary-section p, .sentences-section p {
        font-size: 13px;
        line-height: 1.3;
    }

    .review-link {
        padding: 6px 12px;
        font-size: 11px;
    }

    .review-link .chinese {
        font-size: 11px;
        margin-bottom: 1px;
    }

    .review-link .english {
        font-size: 10px;
    }

    .back-btn {
        padding: 8px 15px;
        font-size: 12px;
        margin-bottom: 15px;
    }

    .back-btn .chinese {
        font-size: 12px;
        margin-bottom: 1px;
    }

    .back-btn .english {
        font-size: 11px;
    }

    /* Course center adjustments */
    .courses-main {
        margin-top: 60px !important;
        padding: 15px 10px;
    }

    .courses-title .chinese {
        font-size: 24px;
        letter-spacing: 1px;
    }

    .courses-title .english {
        font-size: 28px;
    }

    .grade-section {
        margin-bottom: 30px;
        padding: 20px 15px;
    }

    .grade-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .course-card {
        max-width: 280px;
    }

    .course-image {
        height: 120px;
    }

    .course-content {
        padding: 15px;
    }

    .course-name {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .course-description {
        font-size: 13px;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .access-btn {
        padding: 8px 20px;
        font-size: 12px;
    }

    .access-btn .chinese {
        font-size: 12px;
        margin-bottom: 1px;
    }

    .access-btn .english {
        font-size: 11px;
    }

    /* Gallery adjustments */
    .gallery-main {
        margin-top: 60px !important;
        padding: 15px 10px;
    }

    .gallery-title {
        font-size: 24px;
    }

    .gallery-container {
        columns: 1;
        column-gap: 0;
    }

    .gallery-image {
        margin-bottom: 8px;
    }
}