/* =============================================
   Homepage specific styles
   1) Overview Section
   2) WHAT IS COMPUTATIONAL ARTS?
   3) CURRICULUM
   4) SKILLS YOU'LL GAIN
============================================= */

/* Responsive breakpoint variables (default PC), tablet/mobile overrides in media queries */
:root {
    --home-wave-offset: 500px; /* Increase offset to move blue ribbon further down */
}

.each-bottom-section {
    position: relative;
    margin-bottom: 12rem;
}

/* Remove global content padding for homepage to ensure full-screen coverage */
.home-template .main-content {
    padding: 0;
}

.home_background {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--nav-h));
    margin-bottom: 200px; /* Reserve space for overflowing blue ribbon */
    overflow: visible; /* Allow blue ribbon to overflow container */
    background: #000; /* Fallback black background for first screen */
    z-index: 3; /* Ensure first screen is above subsequent content */
}

/* Background image covers entire viewport */
.home_background > img:not(.home__wave) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom; /* Align with blue ribbon position */
    display: block;
    z-index: 1;
}

.home_background .home__wave {
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 70%;
    object-fit: cover;
    object-position: center top;
    display: block;
    z-index: 2;
    pointer-events: none;
}
/* Video styling for homepage background */
.home_background video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* 动态蓝色丝带波浪容器 */
.home_background .wave-container {
    position: absolute;
    width: 100vw;
    height: 20vw;
    top: 100%;
    left: 0;
    transform: translateY(-50%);
    z-index: 4; /* Below text but above background image */
}

/* 动态蓝色丝带波浪效果 */
.home_background .blue-ribbon {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0000FE;
    /* 初始状态为长方形，JavaScript会动态更新 */
    box-shadow: 
        0 2px 0px #0000FE,
        inset 0 2px 0 #0000FE,
        inset 0 -2px 0 #0000FE;
    filter: drop-shadow(0 10px 20px #0000FE);
    pointer-events: none;
}

/* 背景波浪装饰 */
.home_background .background-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    opacity: 0.1;
}

.home_background .background-waves::before,
.home_background .background-waves::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 100px;
    animation: wave 6s ease-in-out infinite;
}

.home_background .background-waves::before {
    top: 20%;
    left: -50%;
    animation-delay: 0s;
}

.home_background .background-waves::after {
    bottom: 20%;
    right: -50%;
    animation-delay: 3s;
}

@keyframes wave {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    50% {
        transform: translateX(-50px) rotate(2deg);
    }
}

/* Right side page name (using <p>) */
.home_background .home_page_name {
    position: absolute;
    right: 4vw;
    bottom: 12vh; /* Positioned above the wave */
    margin: 0;
    color: #ffffff;
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 3.5rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
    z-index: 3;
}

/* Right side three-dot slider */
.home_background .home_slider_dots {
    position: absolute;
    right: 2.2vw;
    top: 30%; /* In background image area, above blue ribbon */
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 4; /* Ensure above blue ribbon */
}
.home_background .home_slider_dots .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #ffffff; /* Unselected filled white */
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.home_background .home_slider_dots .dot.active {
    background: #0033ff; /* Selected blue */
    border-color: #0033ff;
    transform: scale(1.05);
}
.home_background .home_slider_dots .dot:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 102, 255, .35);
}

/* Bottom left main and subtitle container */
.home_background .home_title_wrap {
    position: absolute;
    left: 6vw;
    bottom: 8vh; /* Move down a bit from previous position */
    z-index: 5; /* Ensure above blue ribbon */
    color: #ffffff;
    text-align: left;
}

.home_background .home_title_wrap p {
    margin: 0;
    line-height: 1.05;
    letter-spacing: .02em;
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif !important;
}

/* Responsive font sizes using clamp() for natural transitions */
.home_background .home_title_wrap .home_title { 
    font-size: clamp(2.3rem, 8vw, 9.5rem);
}
.home_background .home_title_wrap .home_subtitle { 
    font-size: clamp(1.2rem, 4.2vw, 5rem); 
    margin-top: .4rem; 
}

/* Ensure homepage subsequent content is positioned after first screen (visual hierarchy and spacing, including overflow) */
/* .home_background + * {
    position: relative;
    z-index: 1; 
    margin-top: var(--home-wave-offset);
}  */

/* =============================================
   1) Overview Section styles
============================================= */

.formal_content{
    margin-top: -8vh; /* Spacing after blue ribbon overflow, desktop */
}

.overview-text h1 {
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: clamp(2.6rem, 4vw, 4rem);
    color: #ffffff;
    margin-bottom: 0.3rem;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.overview-text .title::before,
.cma-text .title::before,
.curriculum-text .title::before {
    content: "#";
    color: #7FEF35;
    margin-right: 10px;
  }

/* # symbol green style */
.overview-text h1 span.hash {
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    color: #7FEF35;
}

.overview-content {
    position: relative;
    width: 100%;
    min-height: 100%;
    margin-bottom: 4rem;
    padding-top: 27vh; /* Reserve upper half screen height, start text from middle height and occupy space */
    overflow: visible; /* Allow image to overflow horizontally without being cropped by parent container */
}

.overview-image {
    position: absolute;
    right: 0;        /* 锚定在右侧 */
    top: 0;
    height: auto;
    margin-top: 12vw;
    margin-right:11.5vw;
    z-index: 1;
    text-align: right;
    overflow: hidden;
}

.overview-image img {
    width: 90%;
    height: auto; /* Scale proportionally with width */
    object-fit: contain; /* Ensure complete display without cropping */
    display: block;
}

.overview-text {
    position: relative; /* Participate in document flow, avoid overlap with following content */
    left: 0; /* Text on left side */
    width: 50vw; /* Text wider, occupies 60vw of screen */
    height: auto;
    padding-top: 15vh; /* 减少顶部内边距 */
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.overview-text p {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    line-height: 1.4;
    color: #ffffff;
    text-align: justify;
    hyphens:none; 
}

/* =============================================
   2) WHAT IS COMPUTATIONAL ARTS? 区块样式
============================================= */

.cma-text {
    position: relative; /* Participate in document flow, avoid overlap with following content */
    left: 0; /* Text on left side */
    width: 68vw; /* Text wider, occupies 68vw of screen */
    max-width: 68vw;
    height: auto;
    padding-top: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.cma-text p {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    line-height: 1.4;
    color: #ffffff;
    margin: 0rem 0; /* Top and bottom spacing 1rem */
    text-align:left;
    width: 100%; /* Control characters per line to form consistent line breaks with design */
    hyphens:none; 
}

.cma-text h2 {
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.cma-text h2 span.hash {
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    color: #7FEF35;
    font-size: clamp(1.5rem, 2vw, 2rem);
}


/* =============================================
   2) WHAT IS COMPUTATIONAL ARTS? 区块样式（容器/卡片）
============================================= */

.container {
    max-width: 60vw;
    margin-left: 2vw;
}

/* WHAT IS COMPUTATIONAL ARTS? Card container: Break parent 60vw limit, display near full width */
.cards-container {
    width: 64vw;          /* Fixed viewport width, break parent container */
    max-width: 64vw;
    margin-left: 1vw;
    text-align: left;
}

.container .grid-wrapper {
    position: relative;
    margin: 40px 0;
    padding: 20px;
}

.container .grid-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -30px; /* Move left outward */
    width: 20px;
    border-left: 12px solid #7CFC00;
}

.container .grid-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -30px; /* Move right outward */
    width: 20px;
    border-right: 12px solid #7CFC00;
}

.container .grid-wrapper .bracket-top-left,
.container .grid-wrapper .bracket-bottom-left {
    position: absolute;
    left: -30px; /* Align with left vertical line and move outward */
    width: 30px;
    height: 12px;
    background: #7CFC00;
}

.container .grid-wrapper .bracket-top-left { 
    top: 0; 
}

.container .grid-wrapper .bracket-bottom-left { 
    bottom: 0; 
}

.container .grid-wrapper .bracket-top-right,
.container .grid-wrapper .bracket-bottom-right {
    position: absolute;
    right: -30px; /* Align with right vertical line and move outward */
    width: 30px;
    height: 12px;
    background: #7CFC00;
}

.container .grid-wrapper .bracket-top-right { 
    top: 0; 
}

.container .grid-wrapper .bracket-bottom-right { 
    bottom: 0; 
}

.container .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2vw;
    row-gap: 5vh; /* Vertical gap after line breaks */
}

/* Display comma separator between cards (hide the last one) */
.grid .card::after {
    content: ",";
    position: absolute;
    right: -12px; /* Place in middle of column gap */
    top: auto;
    bottom: 0; /* Align with image bottom */
    transform: none;
    color: #7FEF35;
    font-size: 2rem;
    line-height: 1;
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    pointer-events: none;
    z-index: 3;
}

.grid .card:last-child::after {
    content: "";
}

.container .card {
    position: relative;
    border-radius: 0px;
    overflow: visible;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.container .card img {
    width: 100%;
    height: auto; /* Scale proportionally */
    aspect-ratio: 2 / 1; 
    object-fit: cover;
    display: block;
}

.container .card-text {
    position: relative; /* Participate in document flow, line breaks can flow below image */
    z-index: 2; /* Above card gradient */
    margin-top: -1.7em; /* Pull first line back above image (adjustable as needed) */
    left: 5%; /* 文字左移5% */
    font-size: clamp(0.7rem, 1.2vw, 1em); /* 响应式字体大小，确保在一行内显示 */
    color: rgba(255, 255, 255, 1);
    background: transparent; /* Gradient provided by .card::after */
    overflow: hidden; /* 隐藏溢出内容 */
    text-overflow: ellipsis; /* 用省略号表示被截断的文本 */
}

/* Gradient background on card container, not text */
.container .card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%; /* 渐变高度为卡片高度的一半 */
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    pointer-events: none;
    z-index: 1; /* Above image but below text */
}


/* =============================================
   3) CURRICULUM 区块样式
============================================= */

.curriculum-text {
    position: relative; /* Participate in document flow, avoid overlap with following content */
    left: 0; /* Text on left side */
    width: 68vw; /* Text wider, occupies 68vw of screen */
    max-width: 68vw;
    height: auto;
    padding-top: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.curriculum-text p {
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    line-height: 1.4;
    color: #ffffff;
    margin: 0rem 0; /* Top and bottom spacing 1rem */
    text-align:left;
    max-width: 92ch; /* Control characters per line to form consistent line breaks with design */
    hyphens:none; 
}

.curriculum-text h2 {
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.curriculum-text h2 span.hash {
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    color: #7FEF35;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.curriculum-text .year-section { 
    margin-top: 5vh; 
    margin-bottom: 1vh; 
}

.curriculum-text .year-title {
    font-size: clamp(1.4rem, 1.65vw, 1.85rem);
    color: #7FEF35;
    font-weight: bold;
    margin-bottom: 1vh;
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.curriculum-text .year-content {
    display: flex;
    align-items: flex-start;
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    gap: 0.5vh;
}

.curriculum-text .bracket {
    font-size: 48px;
    color: #7FEF35;
    font-weight: bold;
    line-height: 1;
    display: inline-block;
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.curriculum-text .year-content > .bracket:last-child { 
    transform: translateX(-3vw); 
}

.curriculum-text .terms-container { 
    display: flex; 
    gap: 0.5vh; 
    flex: 1; 
}

.curriculum-text .term { 
    flex: 1; 
}

.curriculum-text .term-header { 
    display: flex; 
    align-items: center; 
    margin-bottom: 15px; 
}

.curriculum-text .term-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    white-space: normal;
    margin-right: 15px;
    font-family: 'HYFangDieF', 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.curriculum-text .term-line { 
    flex: 1; 
    height: 2px; 
    background-color: #00ff00; 
}

.curriculum-text .course-list { 
    list-style: none; 
    padding-left: 0; 
    margin-left: 0; 
}

.curriculum-text .course-list li {
    color: #ffffff;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    margin-bottom: 5px;
}

.curriculum-text .course-list li::before { 
    content: "• "; 
    color: #ffffff; 
}

.curriculum-text .electives-section {
    margin-top: 3.5vw; 
    margin-left: 0vw;   
}

.curriculum-text .electives-grid {
    display: grid;
    margin-top: 1.5vw;
    grid-template-columns: 1fr 1fr;
    gap: 0.5vh;
    align-items: start;
}

.curriculum-text .electives-column ul { 
    list-style: none; 
    padding-left: 0; 
    margin: 0; 
}

.curriculum-text .electives-column li {
    color: #ffffff;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    margin-bottom: 8px;
    position: relative;
    padding-left: 1.2em;
}

.curriculum-text .electives-column li::before { 
    content: "•"; 
    color: #ffffff; 
    position: absolute; 
    left: 0; 
    top: 0; 
}

/* =============================================
   4) SKILLS YOU'LL GAIN 区块样式
============================================= */

.skills-content {
    position: relative;
    width: 68vw;
    overflow: visible; 
    display: block;
}

.skills-image {
    position: absolute;
    width:100%;    
    height: auto;
    text-align: right;
    overflow: hidden;
}

.skills-image img {
    width: 100%;
    height: auto; /* Scale proportionally */
    object-fit: contain;
    display: block;
}

.skills-text {
    position: relative; /* Participate in document flow, avoid overlap with following content */
    left: 0; /* Text on left side */
    height: auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.skills-text h1  {
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: bold;
    padding-top: 15vw;
    margin-bottom: 1vw;
    text-transform: uppercase;
    letter-spacing: 0px;
}

.skills-text h1::before {
    content: "#";
    color: #7FEF35;
    margin-right: 10px;
}

.skills-content p {
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    line-height:1.4;
    margin-bottom: 1.5vw;
    max-width: none; /* 移除宽度限制 */
    color: #ffffff;
}

.skills-text .skills-list {
    list-style: none;
    max-width: none; /* 移除宽度限制 */
}

.skills-text .skills-list li {
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    line-height: 1.2;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: #ffffff;
    white-space: normal;
    overflow: visible;
}

.skills-text .skills-list li::before {
    content: "•";
    color: #ffffff;
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    position: absolute;
    left: 0;
    top: 0;
}

.skills-text .closing-text {
    font-size: clamp(1rem, 1.33vw, 1.23rem);
    line-height: 1.2;
    margin-top: 1.5vw;
    max-width: none; /* 移除宽度限制 */
    color: #ffffff;
}

/* =============================================
   Responsive Media Queries (整合所有断点)
============================================= */


/* Large screens (1200px-1600px) responsive */
@media (max-width: 1600px) and (min-width: 1200px) {
    .cards-container {
        width: 68vw; /* 增加容器宽度避免溢出 */
        transform: translateX(0vw);
    }

    /* 只移动网格内容，不移动绿色括号 */
    .container .grid {
        transform: translateX(-2vw);
    }
}

/* Medium-large screens (1024px-1200px) responsive */
@media (max-width: 1200px) and (min-width: 1025px) {
    .cards-container {
        width: 68vw; /* 增加容器宽度避免溢出 */
        margin-left: 1vw;
        transform: translateX(1vw);
    }
    
    .container .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.8vw;
        row-gap: 4vh;
        transform: translateX(-1.5vw); /* 只移动网格内容 */
    }
    
    .container .card-text {
        font-size: clamp(0.75rem, 1.1vw, 0.95rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 优化卡片间距和边框 */
    .container .grid-wrapper {
        margin: 35px 0;
        padding: 18px;
    }
}

/* Medium screens (768px-1024px) responsive */
@media (max-width: 1024px){
    .cards-container {
        width: 75vw;
        margin-left: 0.5vw;
        transform: translateX(3vw);
    }
    
    .container .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.2vw;
        row-gap: 4.5vh;
    }
    
    .container .card-text {
        font-size: clamp(0.8rem, 1.4vw, 1.05rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 优化卡片间距和边框 */
    .container .grid-wrapper {
        margin: 30px 0;
        padding: 16px;
    }
}

/* Small-medium screens (481px-768px) responsive */
@media (max-width: 768px) and (min-width: 481px) {
    .cards-container {
        width: 75vw;
        margin-left: 0.5vw;
        transform: translateX(7vw);
    }
    
    .container .grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 2.2vw;
        row-gap: 4.5vh;
    }
    
    .container .card-text {
        font-size: clamp(0.8rem, 1.4vw, 1.05rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 优化卡片间距和边框 */
    .container .grid-wrapper {
        margin: 30px 0;
        padding: 16px;
    }
    
    /* 768px波浪容器位置调整 */
    .home_background .wave-container {
        top: 95%;
        width: 100vw;
        height: 25vw;
    }
    
    /* 768px以下OVERVIEW部分布局调整 */
    .overview-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .overview-image {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        order: -1; /* 确保图片在最上面 */
        margin: 0 0 2rem 0;
        text-align: center;
    }
    
    .overview-image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .overview-text {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        padding-top: 0;
        order: 1; /* 确保文字在图片下面 */
        text-align: center;
    }
    
    .overview-text h1 {
        font-size: clamp(2rem, 4vw, 3rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
        text-align: center;
    }
    
    .overview-text p {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
        white-space: normal;
    }
    
    /* WHAT IS COMPUTATIONAL ARTS? 部分 - 768px以下 */
    .cma-text {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1rem;
        z-index: 2;
        display: block;
        margin-bottom: 2rem;
    }
    
    .cma-text h2 {
        font-size: clamp(1.5rem, 3vw, 2rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
        text-align: left;
    }
    
    .cma-text p {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
        white-space: normal;
    }
    
    /* CURRICULUM 部分 - 768px以下 */
    .curriculum-text {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1rem;
        z-index: 2;
        display: block;
        margin-bottom: 2rem;
    }
    
    .curriculum-text h2 {
        font-size: clamp(1.5rem, 3vw, 2rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
        text-align: left;
    }
    
    .curriculum-text p {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
        white-space: normal;
    }
    
    /* SKILLS YOU'LL GAIN 部分 - 768px以下 */
    .skills-content {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1rem;
        z-index: 2;
        display: block;
        margin-bottom: 2rem;
    }
    
    .skills-image {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin-bottom: 2rem;
    }
    
    .skills-image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .skills-text {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        padding-top: 0;
    }
    
    .skills-text h1 {
        font-size: clamp(1.5rem, 3vw, 2rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
        text-align: left;
        padding-top: 0;
    }
    
    .skills-content p {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
        white-space: normal;
    }
    
    .skills-text .skills-list {
        list-style: none;
        max-width: 100%;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .skills-text .skills-list li {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        margin-bottom: 8px;
        padding-left: 20px;
        position: relative;
        color: #ffffff;
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .skills-text .skills-list li::before {
        content: "•";
        color: #ffffff;
        position: absolute;
        left: 0;
        top: 0;
    }
    
    .skills-content .closing-text {
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        margin-top: 1.5rem;
        max-width: 100%;
        color: #ffffff;
        text-align: left;
        word-wrap: break-word;
        hyphens: auto;
    }

}

/* Tablet (769px-1024px) responsive - 通用平板样式 */
@media (max-width: 1024px) and (min-width: 769px) {
    :root { 
        --home-wave-offset: 380px; /* Also increase offset for tablet */
    }
    
    .home_background { 
        height: calc(92vh - var(--nav-h)); 
    }
    
    .home_background .home_title_wrap { 
        left: 6vw; 
        bottom: 6vh; /* Move down a bit from previous position */
    }
    
    /* 平板端波浪容器位置调整 */
    .home_background .wave-container {
        top: 100%;
    }
    
    .home_background .home_slider_dots { 
        right: 3vw; 
        top: 28%; 
    }
    
    .home_background .home_page_name {
        right: 5vw;
        bottom: 14vh;
        font-size: 2.4rem;
    }
    
    /* Overview Section */
    .formal_content {
        margin-top: -12vh; /* Moderate adjustment for tablet */
    }
    
    .overview-content {
        display: flex;
        flex-direction: column;
        min-height: auto;
        margin-bottom: 3rem;
        padding: 1vh;
        width: 68vw;
        max-width:  68vw;
    }
    
    .overview-image {
        position: static;
        width: 100%;
        height: auto;
        order: -1; /* 确保图片在最上面 */
        margin: 0 0 2rem 0; /* 添加底部间距 */
        text-align: center;
    }
    
    .overview-image img {
        width: 100%;
        max-width: 600px; /* 平板端稍大的最大宽度 */
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .overview-text {
        position: static;
        width: 100%;
        height: auto;
        display: block;
        padding-top: 0;
        order: 1; /* 确保文字在图片下面 */
    }
    
    .overview-text h1 {
        font-size: clamp(2rem, 4vw, 3rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .overview-text p { 
        font-size: clamp(1rem, 1.5vw, 1.2rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
    }
}

/* 通用平板样式 (769px-1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .home_background .wave-container {
        top: 95%;
    }
}

/* Mobile (<=480px) responsive */
@media (max-width: 480px) {
    :root { 
        --home-wave-offset: 300px; /* Also increase offset for mobile */
    }
    
    .home_background { 
        height: calc(88vh - var(--nav-h)); 
    }
    
    .home_background .home_title_wrap { 
        left: 6vw; 
        bottom: -5vh; 
    }
    
    /* 移动端波浪容器位置调整 */
    .home_background .wave-container {
        top: 95%;
        width: 100vw;
        height: 25vw;
    }
    
    .home_background .home_slider_dots { 
        right: 4vw; 
        top: 26%; 
    }
    
    /* Overview Section */
    .formal_content {
        margin-top: -16vh; /* Further adjustment for mobile */
    }
    
    .overview-content {
        display: flex;
        flex-direction: column;
        min-height: auto;
        padding: 1vh;
        margin-bottom: 3rem;
        padding-top: 0; /* 移除顶部内边距 */
        width: 100%; /* 确保容器占满父元素宽度 */
    }
    
    .overview-image {
        position: static;
        width: 100%;
        height: auto;
        order: -1; /* 确保图片在最上面 */
        margin: 0 0 2rem 0; /* 添加底部间距 */
        text-align: center;
    }
    
    .overview-image img {
        width: 100%;
        margin-top: 5vh;
        max-width: 500px; /* 限制最大宽度 */
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px; /* 添加圆角 */
    }
    
    .overview-text {
        position: static;
        width: 100%;
        height: auto;
        display: block;
        padding-top: 0;
        order: 1; /* 确保文字在图片下面 */
    }
    
    .overview-text h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .overview-text p {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        line-height: 1.6;
        text-align: left; /* 手机端文本左对齐更易读 */
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word; /* 确保长单词正确换行 */
        hyphens: auto; /* 启用自动连字符 */
    }
    
    /* 为移动端添加触摸友好的间距 */
    .overview-content {
        touch-action: manipulation; /* 优化触摸响应 */
    }
    
    /* 确保图片在移动端有合适的点击区域 */
    .overview-image {
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .overview-image:hover {
        transform: scale(1.02);
    }
    
    .overview-image:active {
        transform: scale(0.98);
    }
    
    /* WHAT IS COMPUTATIONAL ARTS? Section - Mobile */
    .cma-text {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1vh;
        z-index: 2;
        display: block;
        margin-bottom: 2rem;
    }
    
    .cma-text h2 {
        font-size: clamp(1.3rem, 2vw, 1.3rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .cma-text p {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Cards Container */
    .cards-container {
        width: 96vw;
        margin-left: auto;
        margin-right: auto; /* Center on mobile */
        transform: translateX(0vw);
    }
    
    .container .grid-wrapper {
        margin: 20px 0;
        padding: 15px;
    }
    
    .container .grid-wrapper::before,
    .container .grid-wrapper::after {
        display: block; /* 保留绿色边框在手机端 */
    }
    
    .container .grid-wrapper .bracket-top-left,
    .container .grid-wrapper .bracket-bottom-left,
    .container .grid-wrapper .bracket-top-right,
    .container .grid-wrapper .bracket-bottom-right {
        display: block; /* 保留绿色括号在手机端 */
    }
    
    .container .grid {
        grid-template-columns: 1fr; /* 手机端单列布局 */
        gap: 1.5rem;
        row-gap: 1.5rem;
    }
    
    .container .card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    
    
    .container .card-text {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem); /* 移动端单列布局，字体可以调大 */
        margin-top: -1.5em;
        margin-left: 0.3em;
        white-space: nowrap; /* 强制不换行 */
        overflow: hidden; /* 隐藏溢出内容 */
        text-overflow: ellipsis; /* 用省略号表示被截断的文本 */
    }
    
    /* Mobile hide comma separators */
    .grid .card::after {
        display: none; /* 隐藏手机端的绿色小逗号 */
    }
    
    /* SKILLS YOU'LL GAIN Section - Mobile */
    .skills-content {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1vh;
        z-index: 2;
        display: block;
        margin-bottom: 2rem;
    }
    
    .skills-image {
        position: static;
        width: 100%;
        height: auto;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .skills-image img {
        width: 100%;
        max-width: 500px;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .skills-text {
        position: static;
        width: 100%;
        height: auto;
        display: block;
        padding-top: 0;
    }
    
    .skills-text h1 {
        font-size: clamp(1.3rem, 2vw, 1.3rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
        padding-top: 0;
    }
    
    .skills-text h1::before {
        content: "#";
        color: #7FEF35;
        margin-right: 10px;
    }
    
    .skills-content p {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .skills-text .skills-list {
        list-style: none;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .skills-text .skills-list li {
        font-size: clamp(0.9rem, 3vw, 1rem);
        margin-bottom: 8px;
        text-align: left;
        margin-left: -3vw;
        padding-right: 3vh;
        list-style-position: outside;
        color: #ffffff;
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.6;
    }
    
    .skills-text .skills-list li::before {
        content: "• ";
        color: #ffffff;
    }
    
    .skills-content .closing-text {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        line-height: 1.6;
        margin-top: 1.5rem;
        max-width: 100%;
        color: #ffffff;
        text-align: left;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Curriculum Section - Mobile */
    .curriculum-text {
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 1vh;
        z-index: 2;
        display: block;
        margin-bottom: 2rem;
    }
    
    .curriculum-text h2 {
        font-size: clamp(1.3rem, 2vw, 1.3rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .curriculum-text p {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
        line-height: 1.6;
        text-align: left;
        margin-bottom: 1.2rem;
        max-width: 100%;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .curriculum-text .year-section { 
        margin-top: 3vh; 
        margin-bottom: 2vh; 
    }
    
    .curriculum-text .year-title {
        font-size: clamp(1.2rem, 1.5vw, 1.5rem);
        margin-bottom: 1.5vh;
    }
    
    .curriculum-text .year-content { 
        flex-direction: column; 
        gap: 1vh;
    }
    
    .curriculum-text .terms-container { 
        flex-direction: column; 
        gap: 20px; 
        width: 100%;
    }
    
    .curriculum-text .term { 
        flex: none;
        width: 100%;
    }
    
    .curriculum-text .term-header { 
        margin-bottom: 10px; 
    }
    
    .curriculum-text .term-title {
        font-size: clamp(1rem, 1.2vw, 1.2rem);
        margin-right: 10px;
    }
    
    .curriculum-text .term-line { 
        height: 1px; 
    }
    
    .curriculum-text .bracket { 
        display: none; 
    }
    
    .curriculum-text .course-list li {
        font-size: clamp(0.9rem, 3vw, 1rem);
        margin-bottom: 8px;
        text-align: left;
        padding-left: 1.5em;
        list-style-position: outside;
    }
    
    .curriculum-text .electives-section {
        margin-top: 2vh; 
        margin-left: 0;   
    }
    
    .curriculum-text .electives-section .term-title {
        font-size: clamp(1rem, 1.2vw, 1.2rem);
        margin-bottom: 1vh;
    }
    
    .curriculum-text .electives-grid { 
        grid-template-columns: 1fr; 
        gap: 1vh;
        margin-top: 1vh;
    }
    
    .curriculum-text .electives-column li {
        font-size: clamp(0.9rem, 3vw, 1rem);
        margin-bottom: 6px;
        text-align: left;
        padding-left: 1.5em;
        list-style-position: outside;
    }
}


/* Small mobile (<=480px) responsive - 优化小屏手机样式 */
@media (max-width: 480px) {
    :root { 
        --home-wave-offset: 250px; /* Also increase offset for small screen */
    }
    
    .home_background { 
        height: calc(84vh - var(--nav-h)); 
    }
    
    .home_background .home_title_wrap { 
        left: 6vw; 
        bottom: 2vh; 
    }
    
    /* 小屏手机波浪容器位置调整 */
    .home_background .wave-container {
        top: 95%;
    }
    
    .home_background .home_slider_dots { 
        top: 24%; 
    }
    
    .home_background .home_slider_dots .dot { 
        width: 10px; 
        height: 10px; 
    }
    
    /* Overview Section */
    .formal_content {
        margin-top: -20vh; /* Minimum spacing for small mobile */
    }
    
    .each-bottom-section {
        margin-bottom: 3rem;
    }
    
    .overview-content {
        padding: 1vh;
        touch-action: manipulation;
        margin-bottom: 2rem;
    }
    
    .overview-text h1 {
        font-size: clamp(1.4rem, 8vw, 2rem);
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .overview-text p {
        font-size: clamp(0.8rem, 4.5vw, 0.95rem);
        line-height: 1.7;
        text-align: justify; /* 小屏手机也保持左对齐 */
        margin-bottom: 0.9rem;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* 小屏幕卡片网格样式 */
    .cards-container {
        width: 95vw;
        transform: translateX(0vw);
        margin: 0 auto;
    }
    
    .container .grid {
        grid-template-columns: 1fr; /* 单列布局 */
        gap: 1rem;
        row-gap: 1rem;
        padding: 0 0rem;
    }
    
    .container .card-text {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
        white-space: normal; /* 允许换行 */
        overflow: visible; /* 显示完整文本 */
        text-overflow: unset; /* 移除省略号 */
        line-height: 1.3;
        margin-top: -1.5em;
        margin-left: 0.3em;
        margin-right: 0.3em;
    }
    
    /* 优化卡片间距和边框 */
    .container .grid-wrapper {
        margin: 15px 0;
        padding: 10px;
    }
    
    /* 优化卡片样式 */
    .container .card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        border-radius: 8px;
    }
    
    .overview-image img {
        max-width: 400px; /* 进一步减小最大宽度 */
        border-radius: 6px;
    }
    
    /* WHAT IS COMPUTATIONAL ARTS? Section - Small Mobile */
    .cma-text {
        padding: 1vh;
    }
    
    .cma-text h2 {
        font-size: clamp(1.3rem, 2vw, 1.3rem);
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .cma-text p {
        font-size: clamp(0.8rem, 4.5vw, 0.95rem);
        line-height: 1.7;
        text-align: justify;
        margin-bottom: 0.9rem;
    }
    
    .container .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        row-gap: 1rem;
    }
    
    .container .card-text {
        font-size: clamp(0.7rem, 2.5vw, 0.9rem); /* 小屏手机单列布局，字体调大 */
        margin-top: -1.2em;
        margin-left: 0.2em;
        white-space: nowrap; /* 强制不换行 */
        overflow: hidden; /* 隐藏溢出内容 */
        text-overflow: ellipsis; /* 用省略号表示被截断的文本 */
    }
    
    .container .grid-wrapper {
        margin: 15px 0;
        padding: 10px;
    }
    
    /* SKILLS YOU'LL GAIN Section - Small Mobile */
    .skills-content {
        padding: 1vh;
    }
    
    .skills-text h1 {
        font-size: clamp(1.3rem, 2vw, 1.3rem);
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .skills-content p {
        font-size: clamp(0.8rem, 4.5vw, 0.95rem);
        line-height: 1.7;
        text-align: justify;
        margin-bottom: 0.9rem;
    }
    
    .skills-text .skills-list li {
        font-size: clamp(0.8rem, 4vw, 0.9rem);
        margin-bottom: 5px;
        margin-left: -3vw;
        padding-right: 3vh;
        text-align: left;
        list-style-position: outside;
        white-space: normal;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.7;
    }
    
    .skills-content .closing-text {
        font-size: clamp(0.8rem, 4.5vw, 0.95rem);
        line-height: 1.7;
        text-align: justify;
        margin-top: 1rem;
    }
    
    .skills-image img {
        max-width: 400px;
        border-radius: 6px;
    }
    
    /* Curriculum Section - Small Mobile */
    .curriculum-text {
        padding: 1vh;
    }
    
    .curriculum-text h2 {
        font-size: clamp(1.3rem, 2vw, 1.3rem);
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .curriculum-text p {
        font-size: clamp(0.8rem, 4.5vw, 0.95rem);
        line-height: 1.7;
        text-align: justify;
        margin-bottom: 0.9rem;
    }
    
    .curriculum-text .year-section { 
        margin-top: 2vh; 
        margin-bottom: 1.5vh; 
    }
    
    .curriculum-text .year-title {
        font-size: clamp(1rem, 1.3vw, 1.3rem);
        margin-bottom: 1vh;
    }
    
    .curriculum-text .term-title {
        font-size: clamp(0.9rem, 1vw, 1rem);
        margin-right: 6px;
    }
    
    .curriculum-text .term-line { 
        height: 1px; 
    }
    
    .curriculum-text .course-list li {
        font-size: clamp(0.8rem, 4vw, 0.9rem);
        margin-bottom: 5px;
        text-align: left;
        padding-left: 1.5em;
        list-style-position: outside;
    }
    
    .curriculum-text .electives-section {
        margin-top: 1.5vh; 
    }
    
    .curriculum-text .electives-section .term-title {
        font-size: clamp(0.9rem, 1vw, 1rem);
        margin-bottom: 0.6vh;
    }
    
    .curriculum-text .electives-column li {
        font-size: clamp(0.8rem, 4vw, 0.9rem);
        margin-bottom: 4px;
        text-align: left;
        padding-left: 1.5em;
        list-style-position: outside;
    }
    
    .curriculum-text .terms-container { 
        gap: 15px; 
    }
    
    .curriculum-text .term-header { 
        margin-bottom: 8px; 
    }
}

