body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;

    background: linear-gradient(
        180deg,
        #f7f6f4 0%,
        #eceae7 100%
    );
}

/* 상단 프로젝트 버튼 영역 */

.pdf-list {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 18px;
}

/* 프로젝트 버튼 */

.pdf-btn {
    padding: 10px 18px;
    border-radius: 10px;

    border: 1px solid #e2e2e2;

    background: #ffffff;

    color: #2f2f2f;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: all .2s ease;

    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.pdf-btn.active {
    background: #f3f4f6;
    border: 1px solid #d9d9d9;
}

/* 메인 영역 */

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Viewer 카드 */

.viewer {
    width: 85%;
    height: 90vh;

    background: #ffffff;

    border-radius: 16px;

    box-shadow:
        0 10px 35px rgba(0,0,0,0.12);

    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Viewer header */

.viewer-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #efefef;
    flex-shrink: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.viewer-title {
    margin-left: 20px;
    color: #7a7a7a;
    font-size: 14px;
}

/* 줌 버튼 */

.zoom-controls {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.zoom-controls button {
    width: 28px;
    height: 28px;

    border-radius: 6px;
    border: 1px solid #ddd;

    background: #fff;

    font-size: 16px;
    cursor: pointer;
}

.zoom-controls button:hover {
    background: #f3f3f3;
}

/* Slider */

#slider {
    position: relative;

    display: flex;
    height: calc(100% - 60px);

    overflow: hidden;

    background: #f6f6f6;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* 페이지 */

.page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;

    padding: clamp(20px, 4vw, 60px);

    background: #f6f6f6;

    box-sizing: border-box;
    scroll-snap-align: start;

    overflow: hidden;
}

/* 실제 스크롤 담당 영역 */

.pan-viewport {
    width: 100%;
    height: 100%;

    overflow: auto;

    box-sizing: border-box;
}

/* 확대 좌표계 */

.pan-content {
    min-width: 100%;
    min-height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    box-sizing: border-box;
}

/* 스크롤바 */

.pan-viewport::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.pan-viewport::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.28);
    border-radius: 10px;
}

.pan-viewport::-webkit-scrollbar-track {
    background: transparent;
}

/* 이미지 */

.page img {
    display: block;

    border-radius: 4px;
    object-fit: contain;

    box-shadow: 0 8px 30px rgba(0,0,0,0.15);

    transition:
        width 0.15s ease,
        height 0.15s ease;
}

/* 페이지 번호 */

.page-indicator {
    text-align: center;
    padding: 8px;
    color: #9b9b9b;
    font-size: 13px;
    flex-shrink: 0;
}

/* 네비 버튼 */

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 56px;
    height: 56px;

    border: none;
    border-radius: 50%;

    background: rgba(0,0,0,0.35);

    color: white;
    font-size: 30px;

    cursor: pointer;

    backdrop-filter: blur(4px);

    transition: opacity .25s ease, transform .15s ease;

    z-index: 10;
    opacity: .6;
}

.nav-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.left {
    left: 12px;
}

.right {
    right: 12px;
}

/* Empty state */

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.empty-icon {
    font-size: 60px;
    opacity: .7;
}

.empty-title {
    font-size: 22px;
    font-weight: 600;
    color: #5f5f5f;
}

.empty-desc {
    font-size: 14px;
    color: #9b9b9b;
}

/* 화살표 초기 숨김 */

body:not(.viewer-active) .nav-btn {
    opacity: 0;
    pointer-events: none;
}

body.viewer-active .nav-btn {
    opacity: 1;
    pointer-events: auto;
}

/* 애니메이션 */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.loader {
    width: 60px;
    height: 60px;

    border-radius: 50%;
    border: 4px solid #ddd;
    border-top-color: #666;

    animation: spin 1s linear infinite;
}

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

/* 프로젝트 링크 */

.project-links a {
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.project-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.viewer-active #projectLinks {
    display: block;
}

/* 링크 박스 디자인 */

.resource-box {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);

    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid #e2e2e2;

    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);

    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.resource-box p {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.resource-box div {
    display: flex;
    gap: 20px;
}

.resource-box a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 작은 화면 대응 */

@media (max-width: 768px) {
    .viewer {
        width: 95%;
        height: 88vh;
    }

    .viewer-title {
        margin-left: 12px;
        font-size: 13px;
    }

    .page {
        padding: 18px;
    }

    .nav-btn {
        width: 46px;
        height: 46px;
        font-size: 26px;
    }

    .resource-box {
        bottom: 14px;
        padding: 10px 18px;
    }
}