* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: #d8f1ff;
    color: #244f68;
    font-family: 'Fredoka', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

.demo-page {
    position: relative;
    min-height: 100svh;
    isolation: isolate;
    padding: 100px 24px 72px;
    background:
        linear-gradient(180deg, rgba(219, 243, 255, 0.86), rgba(222, 245, 241, 0.78) 58%, rgba(189, 229, 156, 0.88)),
        url('/assets/img/demo-courses/concepts/neutral-typing-course-v1.jpg') center top / cover no-repeat;
}

.demo-page::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.52), transparent 30%),
        radial-gradient(circle at 88% 28%, rgba(255, 255, 255, 0.34), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(224, 247, 236, 0.14));
    content: "";
}

.demo-info-button {
    border: 0;
    background: transparent;
}

.demo-courses {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.demo-courses-header {
    margin: 14px 0 30px;
    text-align: center;
}

.demo-courses-header h1 {
    margin: 0;
    color: #1976b7;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
}

.demo-course-showcase {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(430px, 1fr);
    gap: 24px;
    align-items: start;
    margin: 0 auto;
}

.demo-ghost-feature {
    position: relative;
    display: grid;
    min-height: 300px;
    overflow: hidden;
    border: 4px solid #fff3c9;
    border-radius: 8px;
    background:
        radial-gradient(circle at 76% 22%, rgba(255, 255, 255, 0.74), transparent 24%),
        radial-gradient(circle at 20% 72%, rgba(255, 218, 112, 0.28), transparent 28%),
        linear-gradient(145deg, rgba(255, 244, 215, 0.98) 0%, rgba(255, 255, 255, 0.94) 45%, rgba(255, 205, 91, 0.90) 100%);
    box-shadow: 0 18px 38px rgba(143, 104, 33, 0.20);
    color: #623d08;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.demo-ghost-feature::before {
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 184, 53, 0.42);
    border-radius: 6px;
    content: "";
    pointer-events: none;
}

.demo-ghost-feature::after {
    position: absolute;
    right: -42px;
    bottom: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 179, 39, 0.18);
    content: "";
}

.demo-ghost-feature:hover {
    border-color: #ffd66d;
    box-shadow: 0 24px 48px rgba(143, 104, 33, 0.26);
    transform: translateY(-6px);
}

.demo-ghost-feature:focus-visible {
    outline: 4px solid rgba(255, 183, 49, 0.40);
    outline-offset: 4px;
}

.demo-ghost-feature-number {
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 1;
    color: #9b6400;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.demo-ghost-feature-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1;
    border-radius: 999px;
    background: #ffb51f;
    padding: 7px 12px;
    color: #3e2c05;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(167, 108, 0, 0.18);
}

.demo-ghost-feature-icon {
    position: absolute;
    top: 62px;
    right: 32px;
    z-index: 1;
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 12px 16px rgba(145, 94, 0, 0.18));
    transition: transform 0.18s ease;
}

.demo-ghost-feature:hover .demo-ghost-feature-icon {
    transform: translateY(-5px) rotate(-3deg) scale(1.04);
}

.demo-ghost-feature-copy {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 330px;
    flex-direction: column;
    align-self: end;
    gap: 10px;
    padding: 112px 28px 28px;
}

.demo-ghost-feature-title {
    color: #9f6400;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.08;
}

.demo-ghost-feature-description {
    color: #6b562a;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
}

.demo-ghost-feature-cta {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    border-radius: 999px;
    background: #178ed1;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(23, 142, 209, 0.22);
}

.demo-ghost-best {
    display: flex;
    width: fit-content;
    min-width: 172px;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
    padding: 11px 16px;
    border: 1px solid rgba(255, 184, 53, 0.55);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 8px 18px rgba(167, 108, 0, 0.12);
}

.demo-ghost-best:empty {
    display: none;
}

.demo-ghost-best.is-empty {
    padding: 9px 15px;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.demo-ghost-best-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b07400;
    font-size: 12.5px;
    font-weight: 800;
}

.demo-ghost-best-label i {
    color: #f0a72e;
}

.demo-ghost-best-stat {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: #7a4f08;
}

.demo-ghost-best-stat b {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.demo-ghost-best-unit {
    font-size: 13px;
    font-weight: 700;
}

.demo-ghost-best-meta {
    color: #8a7038;
    font-size: 12.5px;
    font-weight: 600;
}

.demo-ghost-best-empty {
    color: #9a8350;
    font-size: 13px;
    font-weight: 700;
}

.demo-lessons-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0;
}

.demo-course-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.demo-course-card {
    position: relative;
    display: flex;
    min-height: 146px;
    min-width: 0;
    align-items: stretch;
    border: 4px solid #edfcff;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 20px rgba(43, 92, 118, 0.14);
    color: #0038c4;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.demo-course-card:hover {
    border-color: #bcefff;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(43, 92, 118, 0.18);
    transform: translateY(-5px) scale(1.035);
}

.demo-course-card:focus-visible {
    outline: 4px solid rgba(18, 158, 198, 0.32);
    outline-offset: 4px;
}

.demo-course-number {
    position: absolute;
    top: 10px;
    left: 12px;
    color: #0752af;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.demo-course-content {
    display: flex;
    width: 100%;
    min-height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding: 22px 16px 18px;
    text-align: center;
}

.demo-course-icon {
    display: flex;
    width: 64px;
    height: 62px;
    align-items: center;
    justify-content: center;
    margin: 20px 0 14px;
}

.demo-course-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.18s ease;
}

.demo-course-card:hover .demo-course-icon img {
    transform: scale(1.08);
}

.demo-course-content h3 {
    margin: 0;
    color: #0038c4;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
}

@media (max-width: 980px) {
    .demo-course-showcase {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-ghost-feature {
        min-height: 280px;
    }

    .demo-ghost-feature-copy {
        max-width: 520px;
        padding-top: 104px;
    }

}

.demo-info-panel {
    display: grid;
    grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin: 56px auto 0;
    border: 1px solid rgba(100, 165, 190, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.90);
    box-shadow: 0 18px 42px rgba(43, 92, 118, 0.16);
    padding: 30px;
}

.demo-info-image {
    position: relative;
    display: block;
    overflow: hidden;
    max-width: 300px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
}

.demo-info-image img {
    display: block;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(43, 92, 118, 0.14);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.demo-info-image:hover img {
    filter: brightness(0.92);
    transform: scale(1.015);
}

.demo-info-image:focus-visible {
    outline: 4px solid rgba(18, 158, 198, 0.34);
    outline-offset: 4px;
}

.demo-info-zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    border-radius: 18px;
    background: rgba(31, 77, 103, 0.78);
    padding: 6px 12px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.demo-info-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 2px;
}

.demo-info-badge {
    display: inline-flex;
    border-radius: 20px;
    background: linear-gradient(135deg, #2d9ed0 0%, #4ab375 100%);
    padding: 8px 18px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.demo-info-content h2 {
    margin: 0;
    color: #1f4d67;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.demo-info-content h3 {
    margin: 0;
    color: #245f7c;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.demo-info-content p {
    margin: 4px 0 0;
    color: #52758a;
    font-size: 17px;
    line-height: 1.65;
}

.demo-poster-lightbox {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.demo-poster-lightbox:target {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.demo-poster-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 48, 63, 0.72);
}

.demo-poster-lightbox-inner {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    max-height: calc(100svh - 56px);
}

.demo-poster-lightbox-inner img {
    display: block;
    width: 100%;
    max-height: calc(100svh - 56px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.demo-poster-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #245f7c;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.20);
}

.demo-poster-lightbox-close:focus-visible {
    outline: 4px solid rgba(255, 255, 255, 0.56);
    outline-offset: 4px;
}

@media (max-width: 940px) {
    .demo-info-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-info-image {
        width: min(300px, 100%);
    }
}

@media (max-width: 700px) {
    .demo-page {
        padding: 88px 18px 44px;
    }

    .demo-courses-header {
        margin-bottom: 24px;
    }

    .demo-courses-header h1 {
        font-size: 30px;
    }

    .demo-info-panel {
        margin-top: 38px;
        padding: 22px;
    }
}

@media (max-width: 560px) {
    .demo-ghost-feature {
        min-height: 310px;
    }

    .demo-ghost-feature-icon {
        top: 64px;
        right: 20px;
        font-size: 62px;
    }

    .demo-ghost-feature-copy {
        padding: 128px 24px 24px;
    }

    .demo-ghost-feature-title {
        font-size: 28px;
    }

    .demo-ghost-feature-description {
        font-size: 15px;
    }

    .demo-course-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .demo-course-card {
        min-height: 118px;
    }

    .demo-course-content {
        min-height: 118px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 18px;
        padding: 20px 18px 18px 48px;
        text-align: left;
    }

    .demo-course-icon {
        width: 56px;
        height: 54px;
        flex: 0 0 auto;
        margin: 0;
    }

    .demo-course-content h3 {
        margin: 0;
        font-size: 14px;
    }

    .demo-info-content h2 {
        font-size: 26px;
    }

    .demo-info-content h3 {
        font-size: 20px;
    }

    .demo-info-content p {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demo-course-card,
    .demo-ghost-feature,
    .demo-ghost-feature-icon,
    .demo-course-icon img,
    .demo-info-image img,
    .demo-poster-lightbox {
        transition: none;
    }
}
