.pdf-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .pdf-layout {
        grid-template-columns: 1fr;
    }
    .pdf-sidebar {
        order: 2;
    }
}

.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.page-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.page-thumb-wrap {
    aspect-ratio: 1 / 1.414; /* A4 Ratio */
    background: #f7f7fb;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-thumb-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.page-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.loader-inline {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.full-width { width: 100%; }
.mt-1 { margin-top: 4px; }
.xsmall { font-size: 11px; }
