:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --light-gray: #f5f6fa;
    --border-color: #e1e1e1;
}

p,
span {
    font-weight: unset;
}

b,
strong {
    font-weight: bold;
}

.cm1 {
    max-height: 20px;
    display: block;
    object-fit: cover;
    width: 100%;
    min-height: 200px;
}

#main .section {
    background-color: white;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

#main .section:hover {
    transform: translateY(-2px);
}

#main h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 0.5rem;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

#main h2 {
    color: var(--secondary-color);
    font-size: 1.8em;
    margin-top: 0.5rem;
}

#main .heading {
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: bold;
    margin: 1.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--secondary-color);
}

#main .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
}

#main .table td {
    padding: 1rem;
    vertical-align: top;
    border: 1px solid var(--border-color);
}

#main .table tr:nth-child(even) {
    background-color: var(--light-gray);
}

.table td:first-child {
    width: 25%;
    font-weight: bold;
    background-color: var(--primary-color);
    color: white;
}

#main .list {
    list-style-type: none;
    padding-left: 0;
}

.list li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
}

#main .list li:before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0.5rem;
}

#main a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    overflow-wrap: anywhere;
}

#main a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

#main .course-head a:hover,
#main a.btn-apply:hover {
    color: #fff;
    text-decoration: none;
}

#main a.btn-apply {
    display: inline-block;
    margin: 8px 0 4px;
    padding: 1rem 2rem;
    background-color: #3498db;
    color: #fff;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

#main a.btn-apply:hover {
    background-color: #2980b9;
}

#main strong {
    color: var(--primary-color);
}

#main ol {
    padding-left: 1.5rem;
}

#main ol li {
    margin-bottom: 0.5rem;
}

#main p {
    margin: 0.5rem 0;
}

#main .intro-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

#main .flyer-col {
    flex: none;
    width: 100%;
    max-width: none;
}

#main .flyer img {
    width: 100%;
    height: auto;
    display: block;
}

#main .pathway-col {
    flex: none;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

#main .pathway {
    flex: none;
    min-width: 0;
    background: #d3eeff;
    border-radius: 10px;
    padding: 12px 12px 14px;
    margin: 0;
    font-family: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif;
}

#main .pathway-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: #111;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

#main .pathway-icon {
    width: 36px;
    height: 22px;
    flex: 0 0 auto;
}

#main .pathway-steps {
    display: flex;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 10px 2px 0;
}

#main .pathway-steps li {
    flex: 1 1 0;
    margin: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    min-height: 118px;
    min-width: 0;
}

#main .step-level,
#main .step-name,
#main .step-badge {
    color: #fff;
    font-weight: 700;
    line-height: 1.35;
}

#main .step-level {
    font-size: 16px;
    margin-bottom: 2px;
    white-space: nowrap;
}

#main .step-name {
    font-size: 13px;
    white-space: nowrap;
}

#main .step-1,
#main .step-2,
#main .step-3 {
    border: 4px solid #fff;
    border-radius: 14px 62px 62px 14px;
    min-height: 118px;
    width: auto;
    margin: 0;
    padding: 12px 14px;
}

#main .step-1 {
    z-index: 1;
    background: #127cbd;
    padding-right: 72px;
}

#main .pathway-steps li.step-2 {
    z-index: 2;
    background: #107589;
    margin-left: -86px;
    padding-left: 12px;
    padding-right: 72px;
}

#main .pathway-steps li.step-3 {
    z-index: 3;
    background: #3d4999;
    margin-left: -86px;
    padding-left: 18px;
    padding-right: 14px;
}

#main .step-badge {
    position: absolute;
    top: -12px;
    right: 10px;
    background: #fff;
    color: #3d4999;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 999px;
    padding: 3px 10px;
    border: 2px solid #3d4999;
}

#main .ecosystem {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 300px) minmax(0, 0.9fr);
    grid-template-areas:
        "nw wheel ne"
        "sw wheel se";
    align-items: center;
    column-gap: 14px;
    row-gap: 8px;
    margin: 1.1rem 0 0.6rem;
    font-family: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif;
}

#main .ecosystem .eco-wheel {
    grid-area: wheel;
    width: 100%;
    height: auto;
    display: block;
}

#main .eco-copy {
    margin: 0;
    color: #111;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
}

#main .eco-copy a {
    font-size: inherit;
    font-weight: 700;
    line-height: inherit;
}

#main .eco-nw { grid-area: nw; }
#main .eco-ne { grid-area: ne; align-self: start; padding-top: 18px; }
#main .eco-sw { grid-area: sw; }
#main .eco-se { grid-area: se; align-self: end; padding-bottom: 22px; }

#main .eco-ring {
    fill: #fff;
    font-size: 17px;
    font-weight: 700;
    font-family: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif;
}

#main .eco-brand {
    fill: #111;
    font-size: 26px;
    font-weight: 700;
    font-family: Arial, "Microsoft JhengHei", sans-serif;
}

#main .eco-name {
    fill: #111;
    font-size: 16px;
    font-weight: 700;
    font-family: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif;
}

@media (max-width: 768px) {
    #main .table td:first-child {
        width: 35%;
    }

    #main .section {
        padding: 1rem;
        margin: 1rem 0;
    }

    #main h1 {
        font-size: 2em;
    }

    #main h2 {
        font-size: 1.5em;
    }

    #main .ecosystem {
        grid-template-columns: 1fr;
        grid-template-areas:
            "wheel"
            "nw"
            "ne"
            "sw"
            "se";
        row-gap: 10px;
    }

    #main .ecosystem .eco-wheel {
        width: min(100%, 300px);
        justify-self: center;
    }

    #main .eco-ne,
    #main .eco-se {
        align-self: start;
        padding: 0;
    }

    #main .intro-row {
        flex-direction: column;
        align-items: stretch;
    }

    #main .flyer-col {
        flex: none;
        width: 100%;
        max-width: none;
    }

    #main .pathway-col,
    #main .pathway {
        width: 100%;
    }

    #main .pathway-title {
        font-size: 20px;
    }

    #main .pathway-icon {
        width: 44px;
        height: 28px;
    }

    #main .step-level {
        font-size: 20px;
    }

    #main .step-name {
        font-size: 16px;
    }

    #main .pathway-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding-top: 8px;
    }

    #main .pathway-steps li.step-1,
    #main .pathway-steps li.step-2,
    #main .pathway-steps li.step-3 {
        flex: none;
        width: 100%;
        height: auto;
        margin: 0;
        min-height: 96px;
        padding: 16px 64px 16px 20px;
    }

    #main .pathway-steps li.step-3 {
        margin-top: 8px;
    }

    #main .step-badge {
        top: -14px;
        right: 18px;
        font-size: 16px;
    }
}
