.topic-html-content {
    margin-top: 24px;
    line-height: 1.8;
    color: #334155;
}

.topic-page-card {
    overflow: hidden;
    position: relative;
    transform-origin: left center;
    transform-style: preserve-3d;
    will-change: opacity, transform;
}

.topic-page-card::after {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0));
    content: "";
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: opacity 0.18s ease;
}

.topic-page-enter {
    animation: topicPageOpen 0.34s ease-out both;
}

.topic-page-enter-back {
    animation: topicPageOpenBack 0.34s ease-out both;
    transform-origin: right center;
}

.topic-page-exit {
    animation: topicPageClose 0.42s ease-in both;
    pointer-events: none;
}

.topic-page-exit-back {
    animation: topicPageCloseBack 0.42s ease-in both;
    pointer-events: none;
    transform-origin: right center;
}

.topic-page-exit::after {
    opacity: 1;
}

.topic-page-exit-back::after {
    background: linear-gradient(270deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0));
    opacity: 1;
}

@keyframes topicPageOpen {
    from {
        opacity: 0;
        transform: perspective(1400px) rotateY(8deg) translateX(-10px) scale(0.992);
    }

    to {
        opacity: 1;
        transform: perspective(1400px) rotateY(0) translateX(0) scale(1);
    }
}

@keyframes topicPageOpenBack {
    from {
        opacity: 0;
        transform: perspective(1400px) rotateY(-8deg) translateX(10px) scale(0.992);
    }

    to {
        opacity: 1;
        transform: perspective(1400px) rotateY(0) translateX(0) scale(1);
    }
}

@keyframes topicPageClose {
    0% {
        opacity: 1;
        transform: perspective(1400px) rotateY(0) translateX(0) scale(1);
    }

    52% {
        opacity: 0.42;
        transform: perspective(1400px) rotateY(-42deg) translateX(12px) scale(0.99);
    }

    100% {
        opacity: 0;
        transform: perspective(1400px) rotateY(-78deg) translateX(28px) scale(0.985);
    }
}

@keyframes topicPageCloseBack {
    0% {
        opacity: 1;
        transform: perspective(1400px) rotateY(0) translateX(0) scale(1);
    }

    52% {
        opacity: 0.42;
        transform: perspective(1400px) rotateY(42deg) translateX(-12px) scale(0.99);
    }

    100% {
        opacity: 0;
        transform: perspective(1400px) rotateY(78deg) translateX(-28px) scale(0.985);
    }
}

@media (prefers-reduced-motion: reduce) {
    .topic-page-enter,
    .topic-page-enter-back,
    .topic-page-exit,
    .topic-page-exit-back {
        animation: none;
    }
}

.topic-html-content h2,
.topic-html-content h3,
.topic-html-content h4 {
    color: #1d4ed8;
    margin-top: 24px;
    margin-bottom: 12px;
}

.topic-html-content p {
    margin-bottom: 16px;
    font-size: 17px;
}

.topic-html-content ul,
.topic-html-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.topic-html-content li {
    margin-bottom: 8px;
}

.topic-html-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 18px 0;
    border: 1px solid #dbe4ee;
}

.topic-html-content video,
.topic-html-content iframe {
    max-width: 100%;
    border-radius: 14px;
    margin: 18px 0;
}

.topic-html-content blockquote {
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 10px;
}

.topic-html-content mjx-container {
    margin: 12px 0;
    overflow-x: auto;
}

.topic-page-subtitle {
    color: #1d4ed8;
    font-size: 24px;
    font-weight: 800;
    margin: 26px 0 18px;
    text-align: center;
}

.topic-page-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.topic-nav-link,
.section-topic-link {
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    min-height: 36px;
    padding: 0 12px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.topic-nav-link:hover,
.section-topic-link:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.topic-pagination {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid #dbe4ee;
}

.section-topic-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.next-topic-link {
    margin-left: auto;
}

.page-number-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.page-number {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid #dbeafe;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.page-number:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.active-page {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.pagination-arrow {
    font-size: 26px;
    line-height: 1;
}

.disabled-page {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
    box-shadow: none;
}

.disabled-page:hover {
    background: #f8fafc;
    transform: none;
}

.page-ellipsis {
    min-width: 20px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 800;
    letter-spacing: 1px;
}

.lesson-page h2,
.lesson-page h3,
.lesson-page h4,
.lesson-page h5 {
    color: #174ea6;
    margin-top: 24px;
    margin-bottom: 12px;
}

.lesson-page p,
.lesson-page li {
    line-height: 1.7;
    color: #1f2d3d;
}

.lesson-highlight,
.lesson-note,
.lesson-summary {
    padding: 14px 16px;
    border-radius: 12px;
    margin: 16px 0;
}

.lesson-highlight {
    background: #eef5ff;
    border-left: 4px solid #2f6fed;
}

.lesson-note {
    background: #fff8e8;
    border-left: 4px solid #f0b429;
}

.lesson-summary {
    background: #eefaf2;
    border-left: 4px solid #2e9d57;
}

.two-column-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
    margin: 20px 0;
}

.compact-two-column {
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
}

.mass-inertia-layout {
    align-items: start;
}

.lesson-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.lesson-box,
.image-card {
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 14px;
    padding: 16px;
}

.image-card img {
    width: 80%;
    display: block;
    border-radius: 10px;
  
}

.friction-main-image-card {
    padding: 6px;
}

.friction-main-image-card .image-caption {
    margin: 4px 0 0;
    line-height: 1.25;
}

.friction-direction-card {
    background: #ecfdf3;
    padding: 8px;
}

.friction-direction-card img {
    width: 100%;
    max-width: none;
    border: 1px solid #b7d7c3;
    border-radius: 8px;
}

.friction-direction-card .image-caption {
    margin: 4px 0 0;
    line-height: 1.2;
    white-space: nowrap;
}

.image-card svg {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.spectrum-points-grid .lesson-box {
    background: #fff4df;
    border-color: #ffd9a3;
}

.electromagnetic-spectrum-card {
    width: 100%;
    padding: 12px;
}

.electromagnetic-spectrum-card img {
    width: 100%;
    height: 338px;
    object-fit: fill;
    object-position: center;
}

.example-question-parts {
    margin: 16px 0 20px;
}

.example-question-parts p {
    margin: 10px 0;
}

.example-question-parts strong {
    color: #ff1493;
}

.wave-example-diagram-card svg {
    width: min(100%, 720px);
    display: block;
    margin: 0 auto;
}


.force-image-center {
    text-align: center;
    margin: 20px 0;
}

.force-image-center img {
    max-width: 420px;
    width: 100%;
    height: auto;
}

.mirror-ray-diagram-card img {
    display: block;
    width: min(80%, 528px);
    max-width: 100%;
    margin: 0 auto;
}

.image-caption {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.25;
    color: #4b5b76;
    text-align: center;
}

.mirror-ray-diagram-card .image-caption {
    margin-top: 2px;
}

.mirror-ray-diagram-card {
    margin: 8px 0 10px;
}

.wavefront-light-card {
    padding: 8px 8px 6px;
    overflow: hidden;
}

.wavefront-light-card img {
    width: 70%;
    max-width: none;
    margin: 0 auto;
    transform: none;
}

.wavefront-light-card .image-caption {
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.25;
}

.reflection-water-card {
    padding: 8px;
}

.reflection-water-card img {
    width: 100%;
}

.reflection-water-card .image-caption {
    margin: 6px 4px 2px;
}

.uses-reflection-card {
    max-width: 320px;
    margin: 10px auto 0;
    padding: 8px;
}

.uses-reflection-card img {
    width: 100%;
    max-height: 210px;
    object-fit: contain;
}

.uses-reflection-card .image-caption {
    margin: 6px 4px 2px;
}

.reflection-ray-card {
    padding: 8px;
}

.reflection-ray-card img {
    width: 100%;
}

.reflection-ray-card .image-caption {
    margin: 6px 4px 2px;
}

.reflection-definitions-grid {
    gap: 10px;
    margin: 10px 0 14px;
}

.reflection-definitions-grid .lesson-box {
    padding: 10px 12px;
    background: #ecfdf3;
    border-color: #bbf7d0;
}

.reflection-definitions-grid .lesson-box h3 {
    margin: 0 0 4px;
}

.reflection-definitions-grid .lesson-box p {
    margin: 0;
}

.refraction-definitions-grid .lesson-box {
    background: #ecfdf3;
    border-color: #bbf7d0;
}

.refraction-image-card {
    padding: 8px 8px 6px;
}

.refraction-image-card img {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.refraction-image-card .image-caption {
    margin-top: 4px;
    margin-bottom: 0;
}

.snells-key-rules-grid .lesson-box {
    background: #f1f7ff;
    border-color: #c9ddfb;
}

.fiber-optics-card {
    padding: 8px;
    overflow: hidden;
}

.fiber-optics-card img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
    object-position: center;
    margin: 0;
}

.medicine-example-card {
    background: #eef8e8;
    border-color: #cce7c3;
    border-left: 5px solid #2e9d57;
    padding: 18px 20px;
}

.medicine-example-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.medicine-example-card p {
    margin-bottom: 0;
}

.lesson-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
}

.lesson-data-table th,
.lesson-data-table td {
    padding: 9px 10px;
    border: 1px solid #dbe7f5;
    text-align: left;
}

.lesson-data-table th {
    background: #14532d;
    color: #ffffff;
}

.lesson-data-table tbody tr:nth-child(odd) td {
    background: #ecfdf3;
}

.lesson-data-table tbody tr:nth-child(even) td {
    background: #f8fbff;
}

.refractive-index-table-box {
    padding: 0;
    overflow-x: auto;
}

.reflection-simulation-embed {
    margin: 12px 0 24px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #f8fbff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.08);
    padding: 8px;
}

.reflection-simulation-embed iframe {
    width: 100%;
    height: 520px;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    margin: 0;
}

.refraction-simulation-embed {
    margin: 12px 0 24px;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #f8fbff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.08);
    padding: 8px;
}

.refraction-simulation-embed iframe {
    width: 100%;
    height: 540px;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    margin: 0;
}

.forces-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.forces-column {
    background: #f9fbff;
    border: 1px solid #dbe7f5;
    border-radius: 14px;
    padding: 18px;
}

.force-group-title {
    margin-top: 0;
    color: #d63384;
}

.force-group-intro {
    color: #4b5b76;
    margin-bottom: 16px;
}

.force-card {
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.force-card:last-child {
    margin-bottom: 0;
}

.force-card img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    margin: 12px auto;
}

.image-row-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.image-row-two .image-card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 12px;
}

.wide-image img {
    width: 75%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.formula-box {
    margin: 18px 0;
    padding: 16px;
    text-align: center;
    background: #fff4f7;
    border: 2px solid #3da5ff;
    border-radius: 16px;
    font-size: 20px;
    color: #174ea6;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.momentum-conservation-page {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 52%, #f7fbff 100%);
    border-radius: 14px;
    padding: 22px;
    max-width: 100%;
    min-width: 0;
}

.momentum-conservation-page .topic-center-title {
    margin-bottom: 10px;
}

.momentum-hero {
    display: grid;
    gap: 14px;
    margin: 18px 0 24px;
    padding: 18px;
    border: 1px solid #cfe0f5;
    border-radius: 12px;
    background: #eef6ff;
    max-width: 100%;
    min-width: 0;
}

.momentum-hero p {
    margin: 0;
}

.momentum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin: 16px 0 24px;
}

.momentum-card {
    padding: 16px;
    border: 1px solid #d8e6f8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.momentum-card h4 {
    margin: 0 0 8px;
    color: #174ea6;
}

.collision-diagram {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    padding: 14px;
    border: 1px dashed #b7c9e4;
    border-radius: 12px;
    background: #f9fcff;
    max-width: 100%;
    min-width: 0;
    align-content: start;
    align-self: flex-start;
}

.example-body > .collision-diagram {
    flex: 0 0 430px;
    width: 430px;
}

.collision-row {
    display: flex;
    align-items: start;
    justify-content: center;
    gap: 10px;
}

.collision-object {
    box-sizing: border-box;
    width: 118px;
    min-width: 118px;
    min-height: 54px;
    padding: 9px 12px;
    border: 2px solid #2563eb;
    border-radius: 10px;
    background: #dbeafe;
    color: #0f2f6b;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.collision-item {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.collision-motion {
    color: #1d4ed8;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.collision-object.second {
    border-color: #ea580c;
    background: #ffedd5;
    color: #7c2d12;
}

.collision-arrow {
    color: #1d4ed8;
    font-weight: 900;
}

.case-formula {
    margin-top: 10px;
    margin-bottom: 18px;
}

.momentum-conservation-page .example-box {
    margin: 18px 0;
}

.momentum-conservation-page .example-body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    align-items: start;
    min-width: 0;
}

.momentum-conservation-page .example-text {
    min-width: 0;
}

.momentum-conservation-page .force-image-center,
.momentum-conservation-page .collision-diagram {
    align-self: start;
    margin: 0;
}

.momentum-conservation-page .force-image-center img {
    width: 100%;
    max-width: none;
}

.momentum-page-four .example-body {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
    align-items: start;
}

.momentum-page-four .force-image-center {
    width: 100%;
    align-self: start;
    margin: 0;
}

.momentum-page-four .force-image-center img {
    width: 100%;
    max-width: none;
}

.momentum-conservation-page .solution-section p {
    margin-bottom: 10px;
}

.quick-check-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding-left: 20px;
}

.definition-box {
    margin: 18px 0;
    padding: 16px;
    background: #eef8e8;
    border-left: 5px solid #e53935;
    border-radius: 12px;
    font-size: 18px;
    line-height: 1.6;
}

.wave-definitions-grid {
    gap: 12px 24px;
    margin: 12px 0 18px;
}

.wave-definitions-grid .definition-box {
    margin: 0;
    padding: 12px 16px;
    line-height: 1.45;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.keyword-list span {
    background: #eef5ff;
    color: #174ea6;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .topic-html-content {
        margin-top: 18px;
        line-height: 1.7;
    }

    .topic-html-content p,
    .lesson-page p,
    .lesson-page li {
        font-size: 16px;
    }

    .two-column-section,
    .forces-two-columns,
    .compact-two-column,
    .lesson-grid,
    .image-row-two {
        gap: 16px;
    }

    .lesson-box,
    .image-card,
    .forces-column,
    .force-card {
        padding: 12px;
        border-radius: 10px;
    }

    .topic-html-content img {
        margin: 12px auto;
        border-radius: 10px;
    }

    .force-image-center img {
        max-width: 340px;
    }

    .image-card img {
        width: 70%;
        max-height: 240px;
        object-fit: contain;
        margin-left: auto;
        margin-right: auto;
    }

    .force-card img {
        max-height: 170px;
    }

    .image-row-two .image-card img {
        height: 210px;
        object-fit: contain;
    }

    .wide-image img {
        width: 68%;
        max-height: 240px;
    }

    .animation-embed {
        margin: 18px 0;
        border-radius: 10px;
    }

    .animation-embed iframe,
    .topic-html-content iframe {
        height: clamp(440px, 58vw, 620px) !important;
    }
}

@media (max-width: 900px) {
    .two-column-section,
    .forces-two-columns,
    .compact-two-column,
    .image-row-two,
    .lesson-grid {
        grid-template-columns: 1fr;
    }

    .momentum-conservation-page .example-body {
        grid-template-columns: 1fr;
    }

    .image-row-two .image-card img {
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 768px) {
    .lesson-highlight,
    .lesson-note,
    .lesson-summary,
    .definition-box,
    .formula-box {
        padding: 12px;
    }

    .momentum-conservation-page {
        padding: 14px;
    }

    .collision-row {
        flex-wrap: wrap;
    }

    .image-card img,
    .wide-image img {
        width: 100%;
    }

    .force-card img,
    .image-card img {
        max-height: 190px;
    }

    .animation-embed {
        margin: 16px 0;
    }

    .animation-embed iframe,
    .topic-html-content iframe {
        height: clamp(340px, 62vw, 480px) !important;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    .topic-header {
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .page-card .topic-title {
        font-size: 20px !important;
        line-height: 1.15;
    }

    .topic-pagination {
        margin-top: 24px;
        padding-top: 14px;
    }

    .section-topic-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .section-topic-link {
        justify-content: center;
        text-align: center;
    }

    .page-number-list {
        gap: 5px;
    }

    .page-number {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 14px;
    }

    .pagination-arrow {
        font-size: 22px;
    }

    .page-ellipsis {
        min-width: 12px;
        height: 32px;
        font-size: 14px;
        letter-spacing: 0;
    }

    .animation-embed,
    .animation-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .animation-embed iframe,
    .animation-scroll iframe,
    .topic-html-content iframe[src*="/assets/animations/"] {
        width: 760px !important;
        max-width: none !important;
        height: 620px !important;
    }

    .reflection-simulation-embed iframe {
        height: 500px !important;
    }

    .refraction-simulation-embed iframe {
        height: 520px !important;
    }
}
.example-box {
    border: 2px solid #00a8ff;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.example-header {
    background-color: rgb(48, 70, 97);
    color: white;
    padding: 10px;
    font-weight: bold;
}

.example-body {
    display: flex;
    padding: 15px;
    gap: 20px;
}

.example-text {
    min-width: 0;
    width: 100%;
}

.example-question-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(104px, 32%);
    gap: 12px;
    align-items: start;
}

.example-question-media p {
    margin-top: 0;
}

.example-question-media .example-image-placeholder {
    min-width: 0;
}

.example-question-media img {
    display: block;
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

.worked-toggle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
}

.toggle-btn.worked-toggle-btn {
    border: 0;
    border-radius: 8px;
    background: #1d4ed8;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 9px 14px;
}

.toggle-btn.worked-toggle-btn:hover,
.toggle-btn.worked-toggle-btn:focus-visible {
    background: #1e40af;
}

.worked-toggle-panel,
.hidden-answer.worked-toggle-panel {
    display: none;
}

.worked-toggle-panel.show,
.hidden-answer.worked-toggle-panel.show {
    display: block;
}

.worked-solution-full,
.worked-solution.worked-solution-full {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

.worked-solution-actions-full {
    grid-column: 1 / -1;
    width: 100%;
}

.worked-solution-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: 28px;
    align-items: start;
    width: 100%;
}

.worked-solution-text,
.worked-solution-diagrams {
    min-width: 0;
}

.worked-solution-diagrams {
    display: grid;
    gap: 16px;
}

.worked-solution-diagram-item {
    border: 1px solid #d7e3f2;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
    width: 80%;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

.worked-solution-diagram-item .worked-diagram,
.worked-solution-diagram-item .diagram-wrap,
.worked-solution-diagram-item .mini-diagram-card,
.worked-solution-diagram-item .case-grid {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.worked-solution-diagram-item svg,
.worked-solution-diagram-item img {
    max-width: 100%;
    height: auto;
}

.worked-question-diagram-frame,
.worked-analysis-diagram-frame {
    display: flex;
    justify-content: center;
}

.worked-analysis-diagram-only,
.worked-analysis-diagram-copy {
    display: block;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.worked-question-diagram-only {
    display: block;
    width: 51.2%;
    margin-left: auto;
    margin-right: auto;
}

.worked-answer-only {
    border-left: 4px solid #1d4ed8;
    background: #eff6ff;
    border-radius: 8px;
    margin: 12px 0;
    padding: 12px 14px;
}

.worked-answer-solution-actions {
    margin: 10px 0 0;
}

@media (max-width: 900px) {
    .worked-solution-columns {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .rocket-propulsion-section .example-body {
        flex-direction: column;
        overflow: hidden;
    }

    .rocket-propulsion-section .example-image-placeholder {
        order: 1;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .rocket-propulsion-section .example-text {
        order: 2;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .rocket-propulsion-section .example-image-placeholder p {
        width: 100%;
        margin: 0;
    }

    .rocket-propulsion-section img {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        object-fit: contain;
    }
}

.solution-label {
    background: #47b3e9;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.note-box {
    background: #f9f9f9;
    border-left: 4px solid #ffcc00;
    padding: 10px;
    margin: 15px 0;
}

.formula-display {
    text-align: center;
    font-size: 1.2em;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    margin-top: 10px;
}
.animation-embed {
    margin: 24px 0;
    border: 2px solid #d8ecff;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.animation-embed iframe {
    display: block;
    width: 100%;
}

.diffraction-simulation-card {
    padding: 4px;
}

.diffraction-water-card,
.huygens-principle-card {
    padding: 6px;
    background: #eaf6ff;
    border-radius: 10px;
}

.diffraction-water-card img,
.huygens-principle-card img {
    width: 100%;
    margin: 0;
}

.diffraction-water-card .image-caption,
.huygens-principle-card .image-caption {
    margin-top: 4px;
}

.single-slit-diagram-section {
    display: flex;
    justify-content: center;
    margin: 10px 0 16px;
}

.single-slit-diagram-card {
    width: fit-content;
    max-width: 100%;
}

.single-slit-diagram-card img {
    width: auto;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.wave-comparison-grid .lesson-box {
    background: #eaf6ff;
    border-color: #bfdbfe;
}

.diffraction-simulation-card .diffraction-simulation-embed {
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}

.animation-embed.diffraction-simulation-embed iframe {
    height: 360px !important;
    margin: 0;
    border-radius: 8px;
}

.animation-embed.light-diffraction-simulation-embed iframe {
    height: 520px !important;
}

@media (max-width: 600px) and (orientation: portrait) {
    .animation-embed,
    .animation-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .animation-embed iframe,
    .animation-scroll iframe,
    .topic-html-content iframe[src*="assets/animations"] {
        display: block;
        width: 760px !important;
        min-width: 760px !important;
        max-width: none !important;
        height: 620px !important;
    }

    .reflection-simulation-embed iframe {
        height: 500px !important;
    }

    .refraction-simulation-embed iframe {
        height: 520px !important;
    }
}

.force-arrow {
    position: absolute;
    top: 42px;
    left: 108px;
    width: 98px;
    height: 4px;
    background: #e53935;
    border-radius: 999px;
}
.topic-center-title {
    text-align: center;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 18px;
}

.conditions-row {
    display: flex;
    gap: 44px;
    flex-wrap: wrap;
    margin-top: 18px;
    font-size: 18px;
}

.important-note-custom {
    border-left: 4px solid #c0392b;
    background: #fff9e6;
    padding-top: 0;
}

.important-note-header {
    background: #c0392b;
    color: #fff;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    margin: -14px -16px 12px;
    font-size: 16px;
    text-align: center;
}

.important-note-text {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.formula-box-left {
    text-align: left;
    padding: 14px 20px;
}

.info-card-text {
    font-size: 16px;
}

.practice-link-block {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #dbe4ee;
}

.practice-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.practice-link {
    color: #2563eb;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.practice-link:hover {
    text-decoration: underline;
}
.important-note-box {
    border-left: 4px solid #c0392b;
    background: #fff9e6;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0;
}

.important-note-box-header {
    background: #c0392b;
    color: #fff;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    margin: -14px -16px 12px;
    font-size: 16px;
    text-align: center;
}

.important-note-box-text {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    color: #1f2d3d;
}
.practice-link-block {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #add884;
}

.practice-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.practice-link {
    color: #2563eb;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.practice-link:hover {
    text-decoration: underline;
}
.practice-callout {
    margin: 32px 0 24px;
    padding: 20px;
    background: linear-gradient(135deg, #b3d7dc, #f8fbff);
    border: 1px solid #cfe0ff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}

.practice-callout-header {
    font-size: 24px;
    font-weight: 700;
    color: #174ea6;
    margin-bottom: 10px;
}

.practice-callout-text {
    font-size: 16px;
    color: #4b5b76;
    margin-bottom: 16px;
}

.practice-link-list--boxed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.practice-link--boxed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 12px;
    padding: 14px 16px;
    color: #2563eb;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.25s ease;
}

.practice-link--boxed:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.practice-link-arrow {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
}

.term-video-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    border-bottom: 2px solid #2563eb;
    background: transparent;
    color: #174ea6;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.term-video-trigger:hover,
.term-video-trigger:focus-visible {
    color: #0f3f8c;
    border-bottom-color: #0f3f8c;
}

.term-video-symbol {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.term-video-symbol::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 2px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #ffffff;
}

.term-video-widget {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
}

.term-video-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border: 1px solid #cfe0ff;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
    padding: 16px;
}

.term-video-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.term-video-header h2 {
    margin: 0;
    color: #174ea6;
    font-size: 22px;
}

.term-video-close {
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
}

.term-video-close:hover,
.term-video-close:focus-visible {
    background: #e2e8f0;
}

.term-video-panel video {
    width: 100%;
    max-height: 360px;
    display: block;
    margin: 0;
    border-radius: 10px;
    background: #0f172a;
}

.term-video-fallback {
    display: inline-block;
    margin-top: 12px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}

.term-video-fallback:hover {
    text-decoration: underline;
}
