* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Times New Roman", Georgia, serif;
    background: #f4f5f7;
    color: #1f2933;
    line-height: 1.6;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

.header {
    background: #17202a;
    color: #ffffff;
    padding: 38px 0;
    border-bottom: 1px solid #d0d5dd;
}

.header h1 {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 8px;
}

.header p {
    color: #d6dce3;
    font-size: 17px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 28px 0;
}

.sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    background: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    padding: 14px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar a {
    text-decoration: none;
    color: #253244;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 16px;
    transition: 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    background: #eef1f5;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.card {
    background: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    padding: 26px;
}

.card h2 {
    font-size: 25px;
    margin-bottom: 16px;
    color: #111827;
    border-bottom: 1px solid #e3e7ee;
    padding-bottom: 10px;
}

.card h3 {
    font-size: 20px;
    margin: 20px 0 10px;
    color: #1f2937;
}

.card p {
    margin-bottom: 12px;
    font-size: 17px;
}

ul {
    padding-left: 22px;
    margin-bottom: 10px;
}

li {
    margin-bottom: 8px;
    font-size: 17px;
}

.note {
    margin-top: 18px;
    padding: 14px 16px;
    background: #f1f3f6;
    border-left: 4px solid #5b6472;
    color: #2d3748;
    border-radius: 6px;
}

pre {
    margin-top: 14px;
    background: #111827;
    color: #e5e7eb;
    padding: 18px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: Consolas, monospace;
    font-size: 14px;
    line-height: 1.5;
}

code {
    font-family: Consolas, monospace;
}

.caption {
    text-align: center;
    color: #4b5563;
    font-size: 17px;
    margin: 10px 0 22px;
}

.practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.practice-btn {
    display: block;
    width: 100%;
    border: 1px solid #d9dee7;
    background: #f5f6f8;
    color: #1f2937;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 17px;
    cursor: pointer;
    transition: 0.2s;
}

.practice-btn:hover {
    background: #e9edf3;
}

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

.screenshot-card {
    background: #f7f8fa;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    padding: 10px;
}

.screenshot-card p {
    text-align: center;
    font-size: 16px;
    color: #4b5563;
    margin: 8px 0 0;
}

.exam-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.exam-image:hover {
    opacity: 0.88;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
}

.modal-close,
.pdf-close {
    position: fixed;
    top: 18px;
    right: 24px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #111827;
    font-size: 32px;
    line-height: 38px;
    cursor: pointer;
    z-index: 10001;
}

.modal-close:hover,
.pdf-close:hover {
    background: #e5e7eb;
}

.pdf-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.92);
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.pdf-modal.active {
    display: flex;
}

.pdf-window {
    width: 96vw;
    height: 94vh;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.pdf-window iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.footer {
    padding: 22px 0;
    color: #6b7280;
    font-size: 15px;
    text-align: center;
}

@media (max-width: 850px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .header h1 {
        font-size: 24px;
    }

    .card {
        padding: 20px;
    }

    .image-modal,
    .pdf-modal {
        padding: 12px;
    }

    .pdf-window {
        width: 98vw;
        height: 94vh;
    }
}
