.main-wrap {
    /* max-width: 1400px; */
    margin: 0 auto;
    padding-top: 65px;
    background: #f2f2f2;
}

.news-main,
.share-main,
.course-main {
    width: 100%;
    padding-bottom: 40px;
    /* background-color: white; */
}

.teacher-main,
.recommend-main {
    width: 100%;
    background-color: white;
    padding-bottom: 40px;
}

.quick-links-main {
    width: 100%;
    background-color: white;
    padding: 80px 0;
}

.news-main-wrap {
    max-width: 1366px;
    margin: 0 auto;
    padding: 0 12px;

    .news-card {
        width: 320px;
        position: relative;
        top: 0;

        img {
            width: 100%;
            height: 180px;
            object-fit: cover;
            object-position: center;
            transition: .2s;
        }

        .news-card-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }
    }

    .news-title-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 40px 0 20px 0;

        .news-more-bar {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .news-more-btn:hover {
            color: #b700ff;
            cursor: pointer;
        }
    }

    .news-card:hover {
        top: -5px;
        box-shadow: 0 5px 5px rgba(0, 0, 0, .15);
    }

    .news-card:hover>img {
        width: calc(100% + 30px);
        margin: 0 -15px;
    }
}

.teacher-main-wrap {
    max-width: 1366px;
    margin: 0 auto;
    padding: 0 12px;
    position: relative;

    .teacher-card {
        border-radius: 12px;
        background-color: #f5f5f5;
        /* width: 320px; */
        max-width: 150px;
        position: relative;
        top: 0;
        transition: .2s;
        /* box-shadow: 0 18px 28px rgba(15, 23, 42, 0.12); */
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;

        .teacher-avatar-wrapper {
            width: 100%;
            display: flex;
            justify-content: center;
        }

        .teacher-avatar-circle {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            /* background: #050407; */
            display: flex;
            align-items: flex-start;
            justify-content: center;
            overflow: hidden;
        }

        .teacher-avatar-circle img {
            width: 100%; 
            /* height:100%; */
            object-fit: contain;
            display: block;
        }

        .teacher-info {
            width: 100%;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
        }

        .name {
            font-size: 20px;
            line-height: 1.3;
            font-weight: 700;
            color: #111;
        }

        .teacher-divider {
            width: 100%;
            height: 1px;
            background: #111;
        }

        .teacher-tag {
            background: #ff000080;
            /* color: #7a1200; */
            font-size: 12px;
            padding: 6px 10px;
            border-radius: 10px;
            /* font-weight: 700; */
            max-width: 120px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: inline-block;
            margin: 0 auto;
        }

        .teacher-desc {
            font-size: 15px;
            color: #333;
            font-weight: 500;
            max-width: 150px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin: 0 auto;
        }
    }

    .teacher-card:hover {
        top: -5px;
        box-shadow: 0 5px 5px rgba(0, 0, 0, .15);
    }

    .teacher-title-bar {
        display: flex;
        justify-content: space-between;
        padding: 40px 0 20px 0;

        .teacher-more-bar {
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    .teacher-more-btn:hover {
        color: #b700ff;
        cursor: pointer;
    }
}
.teacher-scroll {
    display: flex;
    gap: 20px;
    max-width: 1366px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
    /* scrollbar-width: none; */
}


.teacher-card-wrapper {
    /* flex: 0 0 260px; */
    width: 260px;
    scroll-snap-align: start;
}

.share-main-wrap {
    max-width: 1366px;
    margin: 0 auto;
    padding: 0 12px;

    .share-list {
        display: flex;
        gap: 24px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .share-card {
        background-color: #fff;
        border-radius: 24px;
        position: relative;
        top: 0;
        transition: .2s;
        box-shadow: 0 10px 18px rgba(12, 10, 66, 0.08);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
        width: 300px;
        min-width: 300px;

        .img {
            width: 300px;
            height: 200px;
            background: #f7f5ff;
        }

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

        .share-content {
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .share-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
        }

        .name {
            font-size: 26px;
            font-weight: 700;
            color: #111;
            line-height: 1.2;
        }

        .share-badge {
            background: #d8b4fe;
            color: white;
            font-size: 12px;
            padding: 6px 10px;
            border-radius: 10px;
            font-weight: 500;
            white-space: nowrap;
        }

        .share-badge.cate-2 {
            background: #ffc9c0;
            color: #8f1a00;
        }

        .share-badge.cate-3 {
            background: #c3f0ff;
            color: #00587c;
        }

        .share-separator {
            width: 100%;
            height: 1px;
            background-color: #111;
        }

        .share-desc {
            font-size: 16px;
            margin-bottom: 10px;
            color: #111;
            font-weight: 500;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
    }

    .share-card:hover {
        top: -8px;
        box-shadow: 0 20px 25px rgba(28, 32, 74, 0.15);
    }

    .share-title-bar {
        display: flex;
        justify-content: space-between;
        padding: 40px 0 20px 0;

        .share-more-bar {
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    .share-more-btn:hover {
        color: #b700ff;
        cursor: pointer;
    }
}

.recommend-main-wrap {
    max-width: 1366px;
    margin: 0 auto;
    padding: 0 12px;

    .recommend-card {
        position: relative;
        top: 0;
    }

    .recommend-card:hover {
        top: -5px;
        box-shadow: 0 5px 5px rgba(0, 0, 0, .15);
    }

    .recommend-card:hover>img {
        width: calc(100% + 30px);
        margin: 0 -15px;
    }

    .recommend-title-bar {
        display: flex;
        justify-content: space-between;
        padding: 40px 0 20px 0;

        .recommend-more-bar {
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    .recommend-more-btn:hover {
        color: #b700ff;
        cursor: pointer;
    }
}


.course-main-wrap {
    max-width: 1366px;
    margin: 0 auto;
    padding: 0 12px;
    .section-title{
        margin: 40px 0 18px 0;
    }
}

.section-title {
    font-size: 1.3rem;
    font-weight: bold;
    /* margin: 40px 0 18px 0; */
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #b700ff;
}

/* 通用標題列與更多按鈕（首頁四大區塊使用） */
.news-title-bar,
.teacher-title-bar,
.share-title-bar,
.recommend-title-bar {
    max-width: 1366px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.news-more-btn,
.teacher-more-btn,
.share-more-btn,
.recommend-more-btn {
    color: #b700ff;
    font-size: 12px;
    cursor: pointer;
    /* padding: 6px 10px; */
    border-radius: 6px;
    transition: background .15s;
}

.news-more-btn:hover,
.teacher-more-btn:hover,
.share-more-btn:hover,
.recommend-more-btn:hover {
    background: #f5f5f5;
}

.carousel {
    width: 100%;
    height: 220px;
    background: #e5e5e5;
    border-radius: 16px;
    margin: 24px 0 32px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* 关键：防止图片溢出 */
}

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

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

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #bbb;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.carousel-arrow.left {
    left: 16px;
}

.carousel-arrow.right {
    right: 16px;
}

.carousel-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1bfff;
    cursor: pointer;
}

.carousel-dot.active {
    background: #b700ff;
}

.news-list,
.course-list,
.share-list,
.teacher-list,
.recommend-list {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    /* padding-bottom: 40px; */
}

.news-main .news-list {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
}

.news-main .news-card {
    flex: 0 0 260px;
    width: 260px;
    scroll-snap-align: start;
}

.news-card,
.course-card,
.recommend-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px #eee;
    padding: 16px;
    /* min-width: 220px;
    max-width: 260px; */
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;

}

.news-card,
.course-card,
.share-card,
.teacher-card,
.recommend-card {
    cursor: pointer;
}

.news-card .img,
.course-card .img,
.recommend-card .img {
    width: 100%;
    /* height: 230px; */
    /* background: #ddd; */
    border-radius: 8px;
    margin-bottom: 12px;
}

.news-card .tag,
.recommend-card .tag {
    display: flex;
    background: #b700ff;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 2px 10px;
    margin-bottom: 6px;
}

.news-card .tag.blue,
.recommend-card .tag.blue {
    background: #4fc3f7;
}

.news-card .tag.green,
.recommend-card .tag.green {
    background: #7ed957;
}

.news-card .date,
.recommend-card .date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 6px;
    margin-left: auto;
}

.news-card .title,
.recommend-card .title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 4px;
}

/* 推薦課程標題：超過兩行以省略號顯示 */
.recommend-card .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 限制顯示兩行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .desc,
.recommend-card .desc {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 4px;
}



.share-list {
    gap: 25px;
}


.recommend-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-bottom: 20px;
}

.recommend-card .img {
    width: calc(100% + 32px);
    height: 200px;
    background: #e0e0e0;
    border-radius: 16px 16px 0 0;
    margin: -16px -16px 12px -16px;
    overflow: hidden;
    position: relative;
}

/* 推薦卡片 */
.recommend-card {
    background-color: #f5f5f7;
    /* Revert to Light Grey */
    border-radius: 16px;
    padding: 16px;
    /* Slightly reduced padding to match design tight fit */
    border: none;
    /* Remove border for cleaner look */
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.recommend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    background-color: #fff;
    /* Highlight on hover */
}

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

.recommend-card .teacher-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Ensure full width for spacing */
}

.recommend-card .teacher-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommend-card .teacher-info .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #ccc;
    flex-shrink: 0;
}

.recommend-card .teacher-info .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommend-card .teacher-info .name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.recommend-card .tags {
    display: flex;
    gap: 6px;
}

.recommend-card .tag-pill {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.recommend-card .tag-pill.purple {
    background: #d8b4fe;
    color: #5a0080;
}

.recommend-card .tag-pill.blue {
    background: #bae6fd;
    color: #0369a1;
}

.recommend-card .title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 4px 0;
    height: 2.8em;
    /* Fixed height for 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-card .price-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
    width: 100%;
    /* Ensure full width */
    margin-top: auto;
    /* Push to bottom of available space */
}

.recommend-card .old-price {
    text-decoration: line-through;
    color: #aaa;
    font-weight: 500;
}

.recommend-card .course-hours {
    color: #444;
    font-weight: 600;
}

.recommend-card .main-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ff8c00;
    margin: 4px 0 8px 0;
}

.recommend-card .add-cart-btn {
    width: calc(100% + 32px);
    margin: 12px -16px -16px -16px;
    background: #d8b4fe;
    color: #2e1065;
    border: none;
    border-radius: 0 0 16px 16px;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.recommend-card .add-cart-btn:hover {
    background: #c084fc;
}

.course-section {
    display: flex;
    gap: 24px;
    /* margin: 36px 0; */
}

.course-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 12px;
    padding: 20px;
    background-color: white;
}

.course-tab {
    background: #f2f2f2;
    border-radius: 8px;
    padding: 15px 16px;
    font-size: 1rem;
    color: #333;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-tab.active,
.course-tab:hover {
    background: linear-gradient(205deg, #b700ff4d 0%, #b600ff00 86.2542%, #b700ff4d 100%);
    color: #b700ff;
}

.course-video {
    flex: 2;
    background: #ddd;
    border-radius: 12px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-links {
    max-width: 1366px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    /* margin: 36px 0 15px 0; */
    justify-content: space-between;
}

.quick-link {
    flex: 1;
    background: #b700ff26;
    border-radius: 16px;
    padding: 21px 0;
    text-align: center;
    color: #333;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.quick-link i {
    font-size: 3.5rem;
    margin-bottom: 8px;
    opacity: 0.08;
    position: absolute;
    left: 18px;
    top: 18px;
    pointer-events: none;
}

.quick-link .btn {
    margin-top: 8px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 10px 28px;
    font-size: 1rem;
    cursor: pointer;
}

.footer {
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: 36px;
    padding: 36px 0 0 0;
    font-size: 0.98rem;
    color: #444;
}

.footer .footer-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
}

.footer .footer-col {
    min-width: 180px;
    flex: 1;
    margin-bottom: 18px;
}

.footer .footer-col-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #b700ff;
}

.footer .footer-contact {
    margin-top: 12px;
    color: #b700ff;
    font-weight: bold;
}

.footer .footer-bottom {
    background: #b700ff;
    color: #fff;
    text-align: center;
    padding: 16px 0 0 0;
    margin-top: 24px;
    font-size: 0.98rem;
}

@media (max-width: 900px) {

    /* 全站基準字級（手機端） */
    html,
    body {
        font-size: 14px;
    }

    /* 手機端 Banner/Swiper 高度覆蓋（index.blade 內聯樣式的覆蓋） */
    .main-wrap .mySwiper {
        height: 200px !important;
        padding-top: 75px;
    }

    /* 手機端隱藏師資左右箭頭，避免遮擋內容 */
    .teacher-main-wrap .teacher-prev,
    .teacher-main-wrap .teacher-next {
        display: none;
    }

    /* 標題列縮小間距與字級 */
    .news-title-bar,
    .teacher-title-bar,
    .share-title-bar,
    .recommend-title-bar {
        padding: 0 8px;
    }

    .news-more-btn,
    .teacher-more-btn,
    .share-more-btn,
    .recommend-more-btn {
        font-size: 0.95rem;
        padding: 4px 8px;
    }

    .main-wrap {
        padding: 0 4px;
    }

    .news-list,
    .course-list,
    .teacher-list {
        flex-wrap: wrap;
        gap: 8px;
    }

    .recommend-list {
        display: flex;
        flex-wrap: nowrap;
        gap: 18px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 6px 20px;
        scroll-snap-type: x proximity;
    }

    .recommend-list::-webkit-scrollbar {
        display: none;
    }

    .news-main .news-list {
        flex-wrap: nowrap;
    }

    .teacher-main-wrap .teacher-card {
        width: 240px;
        min-width: 240px;
        padding: 24px 18px 28px;
    }

    .teacher-main-wrap .teacher-avatar-circle {
        width: 170px;
        height: 170px;
    }

    .teacher-main-wrap .teacher-card .name {
        font-size: 22px;
    }

    .share-main-wrap .share-list {
        flex-wrap: nowrap;
        gap: 16px;
    }

    .news-card,
    .course-card,
    .share-card,
    .recommend-card {
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px #eee;
        padding: 16px;
        /* width: 50%; */

        min-width: 150px;
        /* max-width: 260px; */
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .carousel {
        height: 120px;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .recommend-card {
        flex: 0 0 calc(100vw - 60px);
        width: calc(100vw - 60px);
        min-width: 260px;
        max-width: none;
        border-radius: 24px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        padding: 20px;
        scroll-snap-align: start;
    }

    .recommend-card .img {
        width: calc(100% + 40px);
        height: 220px;
        margin: -20px -20px 12px;
        border-radius: 24px 24px 0 0;
    }

    .recommend-card .add-cart-btn {
        width: calc(100% + 40px);
        margin: 16px -20px -20px;
        border-radius: 0 0 24px 24px;
        font-size: 1.05rem;
    }

    /* 手機端：快速入口字級縮小 */
    .quick-link {
        font-size: 1.05rem;
    }

    /* 手機端：推薦課程價格字級微調 */
    .recommend-card .price-new {
        font-size: 1rem;
    }

    .course-section {
        flex-direction: column;
        gap: 12px;
    }

    .quick-links {
        flex-direction: column;
        gap: 12px;
    }

    .footer .footer-main {
        flex-direction: column;
        gap: 8px;
    }
}