:root {
    --ink: #1d2430;
    --muted: #647084;
    --line: #dfe5ea;
    --paper: #ffffff;
    --wash: #f5f8f7;
    --teal: #007a78;
    --teal-dark: #005f61;
    --yellow: #f2c14e;
    --coral: #e95f4d;
    --green: #4f9d69;
    --blue: #2d6cdf;
    --shadow: 0 18px 42px rgba(29, 36, 48, 0.12);
    --radius: 8px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    letter-spacing: 0;
    background: var(--paper);
}

img {
    display: block;
    max-width: 100%;
}

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

a:hover {
    color: var(--teal);
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.2;
    letter-spacing: 0;
}

h1 {
    font-size: 3.6rem;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.2rem;
}

p {
    margin: 0 0 1rem;
}

.container {
    width: min(calc(100% - 32px), var(--max));
    margin: 0 auto;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 1000;
    transform: translateY(-140%);
    padding: 8px 12px;
    background: var(--ink);
    color: white;
    border-radius: var(--radius);
}

.skip-link:focus {
    transform: translateY(0);
}

.topbar {
    background: var(--ink);
    color: white;
    font-size: 0.9rem;
}

.topbar-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: flex-end;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.nav-shell {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
}

.brand-logo {
    width: 118px;
    height: 54px;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.25rem;
}

.brand small {
    color: var(--muted);
    font-size: 0.82rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-weight: 700;
}

.site-nav a {
    padding: 8px 0;
}

.site-nav .nav-cta {
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--teal);
    color: white;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: white;
    border-radius: var(--radius);
    padding: 9px 12px;
    font: inherit;
    font-weight: 800;
}

.hero {
    position: relative;
    min-height: 78vh;
    display: grid;
    align-items: center;
    color: white;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
}

.hero-slider {
    display: block;
    overflow: hidden;
    background: var(--ink);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    transition: opacity 520ms ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-overlay,
.course-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(14, 20, 28, 0.82), rgba(14, 20, 28, 0.48), rgba(14, 20, 28, 0.18));
}

.hero-content,
.course-hero .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    padding: 88px 0 78px;
}

.eyebrow {
    color: var(--coral);
    font-size: 0.88rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero .eyebrow,
.course-hero .eyebrow,
.cta-band .eyebrow {
    color: var(--yellow);
}

.hero-lead {
    max-width: 680px;
    margin-top: 18px;
    font-size: 1.28rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    border: 2px solid var(--yellow);
    border-radius: var(--radius);
    background: var(--yellow);
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
    color: var(--ink);
}

.button-ghost {
    color: white;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.72);
}

.button-ghost:hover {
    color: white;
    border-color: white;
}

.button-secondary {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

.button-secondary:hover {
    color: white;
    background: var(--teal-dark);
}

.button-light {
    background: white;
    border-color: white;
}

.button.full {
    width: 100%;
}

.text-link {
    display: inline-flex;
    font-weight: 900;
    color: var(--teal-dark);
    border-bottom: 2px solid var(--yellow);
}

.hero-dots {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 28px;
    display: flex;
    gap: 10px;
    transform: translateX(-50%);
}

.hero-dots button {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.hero-dots button.active {
    width: 34px;
    background: var(--yellow);
    border-color: var(--yellow);
}

.section {
    padding: 78px 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.section-heading h2 {
    max-width: 720px;
}

.section-heading.narrow {
    display: block;
    max-width: 760px;
    text-align: center;
}

.intro-band {
    border-bottom: 1px solid var(--line);
}

.two-column,
.content-grid,
.split-showcase,
.contact-layout,
.course-detail-layout,
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 44px;
    align-items: start;
}

.two-column {
    align-items: center;
}

.split-showcase {
    align-items: center;
}

.split-showcase.reverse {
    grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1fr);
}

.split-showcase img,
.article-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-grid,
.post-grid,
.gallery-grid,
.ability-grid,
.four-grid,
.value-grid,
.testimonial-grid {
    display: grid;
    gap: 22px;
}

.card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid.three,
.post-grid,
.value-grid,
.testimonial-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.course-card,
.post-card,
.info-card,
.quote-panel,
.contact-aside,
.course-sidebar .info-card,
.four-grid article,
.ability-grid article,
.value-grid article,
.testimonial-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 10px 26px rgba(29, 36, 48, 0.08);
}

.value-grid article {
    padding: 24px;
    border-top: 5px solid var(--teal);
}

.value-grid span {
    display: inline-flex;
    margin-bottom: 16px;
    color: var(--coral);
    font-weight: 900;
}

.course-card {
    overflow: hidden;
}

.course-card-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.course-card-body {
    padding: 18px;
}

.label {
    display: inline-flex;
    margin: 0 0 8px;
    padding: 3px 8px;
    background: rgba(0, 122, 120, 0.1);
    color: var(--teal-dark);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
}

.course-card h3,
.post-card h3 {
    margin-bottom: 8px;
}

.course-card p,
.post-card p {
    color: var(--muted);
}

.course-meta,
.detail-list {
    margin: 16px 0;
}

.course-meta {
    display: grid;
    gap: 10px;
}

.course-meta div,
.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.color-band {
    background: var(--ink);
    color: white;
}

.soft-band {
    background: var(--wash);
}

.ability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ability-grid article,
.four-grid article,
.info-card,
.quote-panel {
    padding: 24px;
}

.ability-grid article:nth-child(2n) {
    border-top: 5px solid var(--yellow);
}

.ability-grid article:nth-child(2n + 1) {
    border-top: 5px solid var(--green);
}

.color-band .ability-grid article {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.color-band p,
.color-band .faq-list p {
    color: rgba(255, 255, 255, 0.82);
}

.learning-path {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
    gap: 44px;
    align-items: center;
}

.learning-path ol {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.learning-path li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
}

.learning-path strong {
    color: var(--yellow);
    font-size: 1.15rem;
}

.learning-path span {
    color: rgba(255, 255, 255, 0.82);
}

.gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid.large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-grid figure {
    position: relative;
    overflow: hidden;
    margin: 0;
    border-radius: var(--radius);
    background: var(--ink);
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 220ms ease;
}

.gallery-grid figure:hover img {
    transform: scale(1.03);
}

.gallery-grid figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    color: white;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0));
}

.gallery-grid figcaption strong,
.gallery-grid figcaption span {
    display: block;
}

.gallery-grid figcaption span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.post-card {
    overflow: hidden;
}

.post-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.post-card > div {
    padding: 18px;
}

time {
    display: block;
    color: var(--coral);
    font-weight: 900;
    margin-bottom: 8px;
}

.faq-list {
    display: grid;
    gap: 12px;
    max-width: 860px;
}

.faq-list details {
    background: white;
    color: var(--ink);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 900;
}

.faq-list p {
    margin: 12px 0 0;
    color: var(--muted);
}

.color-band .faq-list details p {
    color: var(--muted);
}

.cta-band {
    color: white;
    background: var(--teal-dark);
}

.cta-band .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.cta-band h2 {
    max-width: 820px;
}

.page-hero {
    color: white;
    background: var(--ink);
}

.page-hero.compact {
    padding: 80px 0;
    background:
        linear-gradient(90deg, rgba(29, 36, 48, 0.94), rgba(0, 122, 120, 0.72)),
        url("../images/iot-sensor-project.jpg") center / cover;
}

.page-hero h1 {
    max-width: 900px;
    font-size: 2.8rem;
}

.page-hero p {
    max-width: 740px;
    font-size: 1.1rem;
}

.four-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.filter-section {
    padding-bottom: 0;
}

.course-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 24px;
}

label span {
    display: block;
    margin-bottom: 6px;
    font-weight: 900;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 13px;
    color: var(--ink);
    font: inherit;
    background: white;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(242, 193, 78, 0.75);
    outline-offset: 3px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tabs a {
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 900;
}

.category-tabs a.active {
    color: white;
    background: var(--teal);
    border-color: var(--teal);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 36px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.course-hero {
    position: relative;
    min-height: 520px;
    display: grid;
    align-items: center;
    color: white;
    background-image: var(--course-image);
    background-size: cover;
    background-position: center;
}

.course-hero h1 {
    max-width: 880px;
    font-size: 3rem;
}

.course-hero p {
    max-width: 720px;
    font-size: 1.16rem;
}

.course-detail-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.course-content {
    max-width: 760px;
}

.lead {
    color: var(--teal-dark);
    font-size: 1.2rem;
    font-weight: 800;
}

.check-list {
    padding: 0;
    margin: 18px 0 30px;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 14px;
    height: 8px;
    border-left: 3px solid var(--green);
    border-bottom: 3px solid var(--green);
    transform: rotate(-45deg);
}

.stem-bars {
    display: grid;
    gap: 16px;
}

.stem-bar {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 54px;
    gap: 14px;
    align-items: center;
}

.stem-bar span,
.stem-bar strong {
    font-weight: 900;
}

.stem-bar div {
    height: 12px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.stem-bar i {
    display: block;
    height: 100%;
    background: var(--coral);
}

.course-sidebar {
    position: sticky;
    top: 116px;
}

.detail-list div {
    display: block;
}

.detail-list dd {
    margin-top: 4px;
    text-align: left;
}

.article-layout {
    grid-template-columns: 420px minmax(0, 1fr);
}

.article-content {
    max-width: 720px;
}

.contact-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
}

.contact-form {
    display: grid;
    gap: 18px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.contact-intro {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--wash);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.contact-form small,
.form-error {
    color: var(--coral);
    font-weight: 800;
}

.captcha-field {
    padding: 16px;
    border: 1px solid rgba(0, 122, 120, 0.22);
    border-radius: var(--radius);
    background: rgba(0, 122, 120, 0.06);
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(79, 157, 105, 0.42);
    border-radius: var(--radius);
    background: rgba(79, 157, 105, 0.1);
    font-weight: 900;
}

.testimonial-grid article {
    padding: 24px;
}

.testimonial-grid p {
    font-size: 1.08rem;
    color: var(--ink);
}

.testimonial-grid strong,
.testimonial-grid span {
    display: block;
}

.testimonial-grid span {
    color: var(--muted);
}

.contact-aside {
    padding: 24px;
}

.contact-aside article {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.contact-aside article:last-of-type {
    border-bottom: 0;
}

.contact-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--wash);
}

.muted {
    color: var(--muted);
}

.site-footer {
    color: white;
    background: #111822;
    padding: 56px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr;
    gap: 28px;
}

.site-footer h2,
.site-footer h3 {
    margin-bottom: 12px;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.74);
}

.site-footer a:hover {
    color: var(--yellow);
}

.newsletter {
    display: grid;
    gap: 10px;
}

.newsletter input {
    border-color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 1040px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2rem;
    }

    .card-grid,
    .card-grid.three,
    .post-grid,
    .gallery-grid,
    .ability-grid,
    .four-grid,
    .value-grid,
    .testimonial-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-column,
    .content-grid,
    .split-showcase,
    .split-showcase.reverse,
    .contact-layout,
    .course-detail-layout,
    .article-layout {
        grid-template-columns: 1fr;
    }

    .learning-path {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: static;
    }
}

@media (max-width: 860px) {
    .topbar-inner {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: calc(100% - 1px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: white;
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 12px;
    }

    .site-nav .nav-cta {
        text-align: center;
    }

    .hero {
        min-height: 720px;
    }

    .hero-overlay,
    .course-hero-overlay {
        background: rgba(14, 20, 28, 0.72);
    }

    .section-heading,
    .cta-band .container {
        display: block;
    }

    .section-heading .text-link,
    .cta-band .button {
        margin-top: 18px;
    }

    .form-grid,
    .course-search,
    .gallery-grid.large {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    h1,
    .page-hero h1,
    .course-hero h1 {
        font-size: 2.3rem;
    }

    h2 {
        font-size: 1.72rem;
    }

    .brand {
        min-width: auto;
    }

    .brand-logo {
        width: 96px;
        height: 44px;
    }

    .brand small {
        display: none;
    }

    .hero-content {
        padding: 70px 0 58px;
    }

    .hero-lead {
        font-size: 1.05rem;
    }

    .section {
        padding: 56px 0;
    }

    .card-grid,
    .card-grid.three,
    .post-grid,
    .gallery-grid,
    .ability-grid,
    .four-grid,
    .value-grid,
    .testimonial-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .learning-path li {
        grid-template-columns: 1fr;
    }

    .stem-bar {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    dd {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
