﻿.pd-page {
    background: #f5f7fb;
    min-height: 100vh;
    padding: 18px 0 54px;
}

.pd-container {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

.pd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    color: #94a3b8;
    font-size: 12px;
}

    .pd-breadcrumb a {
        color: #2563eb;
        text-decoration: none;
    }

        .pd-breadcrumb a:hover {
            text-decoration: underline;
        }

.pd-summary {
    display: grid;
    grid-template-columns: 128px minmax(0,1fr) 292px;
    gap: 24px;
    padding: 26px;
    border: 1px solid #e4eaf2;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15,23,42,.07);
}

.pd-cover {
    position: relative;
    width: 128px;
    height: 174px;
    overflow: hidden;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg,#2563eb,#1d4ed8);
    box-shadow: 0 15px 28px rgba(37,99,235,.26);
}

    .pd-cover.is-pdf {
        background: linear-gradient(145deg,#ef4444,#b91c1c);
        box-shadow: 0 15px 28px rgba(220,38,38,.24);
    }

    .pd-cover::before {
        content: '';
        position: absolute;
        right: -23px;
        top: -23px;
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: rgba(255,255,255,.12);
    }

    .pd-cover::after {
        content: '';
        position: absolute;
        inset: 0;
        opacity: .16;
        background-image: linear-gradient(rgba(255,255,255,.28) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.28) 1px,transparent 1px);
        background-size: 14px 14px;
        mask-image: linear-gradient(to bottom,black,transparent 72%);
    }

.pd-cover-top {
    position: relative;
    z-index: 1;
    padding: 15px 15px 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    opacity: .88;
}

.pd-cover-title {
    position: relative;
    z-index: 1;
    margin: 20px 14px 0;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 900;
}

.pd-cover-lines {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
    margin: 16px 14px;
}

    .pd-cover-lines span {
        display: block;
        height: 3px;
        border-radius: 999px;
        background: rgba(255,255,255,.34);
    }

        .pd-cover-lines span:nth-child(2) {
            width: 72%;
        }

        .pd-cover-lines span:nth-child(3) {
            width: 86%;
        }

.pd-cover-year {
    position: absolute;
    z-index: 1;
    left: 14px;
    bottom: 13px;
    font-size: 11px;
    opacity: .72;
}

.pd-main {
    min-width: 0;
    padding-top: 2px;
}

.pd-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

    .pd-kicker::before {
        content: '';
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: #2563eb;
    }

.pd-main h1 {
    margin: 10px 0 12px;
    color: #0f172a;
    font-size: clamp(22px,2.4vw,30px);
    line-height: 1.35;
    letter-spacing: -.025em;
    font-weight: 900;
}

.pd-tags {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.pd-tag {
    padding: 4px 9px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
}

    .pd-tag.is-blue {
        background: #eff6ff;
        color: #2563eb;
    }

    .pd-tag.is-green {
        background: #ecfdf5;
        color: #059669;
    }

    .pd-tag.is-gold {
        background: #fffbeb;
        color: #d97706;
    }

.pd-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 14px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.75;
}

.pd-meta-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
    margin-top: 18px;
}

.pd-meta-item {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #edf1f6;
    border-radius: 10px;
    background: #fafcff;
}

    .pd-meta-item span {
        display: block;
        color: #94a3b8;
        font-size: 10px;
    }

    .pd-meta-item strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-top: 4px;
        color: #334155;
        font-size: 12px;
        font-weight: 700;
    }

.pd-action-panel {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border: 1px solid #e4eaf2;
    border-radius: 16px;
    background: linear-gradient(180deg,#f8fbff,#fff);
}

.pd-action-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .pd-action-panel-head strong {
        color: #0f172a;
        font-size: 14px;
    }

.pd-owner {
    padding: 3px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
    font-size: 10px;
}

.pd-actions {
    display: grid;
    gap: 9px;
}

.pd-action {
    width: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: .16s ease;
}

    .pd-action:hover:not(:disabled) {
        transform: translateY(-1px);
        border-color: #93c5fd;
        color: #1d4ed8;
        box-shadow: 0 7px 16px rgba(37,99,235,.10);
    }

    .pd-action:disabled {
        cursor: not-allowed;
        opacity: .48;
    }

    .pd-action.is-primary {
        min-height: 48px;
        border-color: #2563eb;
        background: linear-gradient(135deg,#2563eb,#1d4ed8);
        color: #fff;
        box-shadow: 0 9px 20px rgba(37,99,235,.24);
    }

    .pd-action.is-vip {
        border-color: #f6c453;
        background: linear-gradient(135deg,#fffbeb,#fef3c7);
        color: #a16207;
    }

.pd-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pd-action form {
    margin: 0;
}

.pd-quota {
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.65;
}

    .pd-quota strong {
        color: #334155;
    }

.pd-preview-card {
    position: relative;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
}

.pd-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 15px 18px;
    border-bottom: 1px solid #e8eef6;
    background: #fff;
}

.pd-preview-title {
    min-width: 0;
}

    .pd-preview-title h2 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        color: #0f172a;
        font-size: 16px;
        font-weight: 850;
    }

    .pd-preview-title p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin: 5px 0 0;
        color: #94a3b8;
        font-size: 11px;
        max-width: 560px;
    }

.pd-preview-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.pd-tool {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

    .pd-tool:hover:not(:disabled) {
        border-color: #93c5fd;
        color: #2563eb;
    }

    .pd-tool:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    .pd-tool.is-primary {
        border-color: #2563eb;
        background: #2563eb;
        color: #fff;
    }

.pd-page-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    color: #64748b;
    font-size: 11px;
}

    .pd-page-indicator b {
        color: #0f172a;
    }

.pd-zoom {
    min-width: 44px;
    text-align: center;
    color: #64748b;
    font-size: 11px;
}

.pd-progress {
    height: 3px;
    background: #eef2f7;
}

    .pd-progress span {
        display: block;
        width: 0;
        height: 100%;
        background: linear-gradient(90deg,#2563eb,#60a5fa);
        transition: width .08s linear;
    }

.pd-preview-body {
    background: #e9edf3;
}

.pv-scroll {
    position: relative;
    height: min(76vh,900px);
    overflow-y: auto;
    padding: 22px 0 30px;
    scroll-behavior: smooth;
}

.pv-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.pv-page {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(15,23,42,.16);
    transition: width .15s ease;
}

    .pv-page img {
        display: block;
        width: 100%;
        height: auto;
    }

.pv-num {
    position: absolute;
    right: 10px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15,23,42,.58);
    color: #fff;
    font-size: 10px;
}

.pv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 100px 20px;
    color: #64748b;
    font-size: 13px;
}

.pv-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: pvspin 1s linear infinite;
}

@keyframes pvspin {
    to {
        transform: rotate(360deg);
    }
}

.pd-preview-card:fullscreen {
    border-radius: 0;
    background: #fff;
}

    .pd-preview-card:fullscreen .pv-scroll {
        height: calc(100vh - 74px);
    }

.pd-related {
    margin-top: 28px;
}

.pd-related-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

    .pd-related-head h2 {
        margin: 0;
        color: #0f172a;
        font-size: 20px;
        font-weight: 850;
    }

    .pd-related-head p {
        margin: 5px 0 0;
        color: #94a3b8;
        font-size: 11px;
    }

.pd-related-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
}

.pd-related-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e4eaf2;
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 5px 16px rgba(15,23,42,.035);
    transition: .17s ease;
}

    .pd-related-card:hover {
        transform: translateY(-3px);
        border-color: #bfdbfe;
        box-shadow: 0 13px 28px rgba(37,99,235,.10);
    }

.pd-related-file {
    width: 38px;
    height: 45px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(145deg,#3b82f6,#2563eb);
    color: #fff;
    font-size: 9px;
    font-weight: 850;
}

    .pd-related-file.is-pdf {
        background: linear-gradient(145deg,#ef4444,#dc2626);
    }

.pd-related-body {
    flex: 1;
    min-width: 0;
}

.pd-related-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #334155;
    font-size: 12px;
    line-height: 1.55;
    font-weight: 700;
}

.pd-related-card:hover .pd-related-title {
    color: #2563eb;
}

.pd-related-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 10px;
}

.pd-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 9999;
    transform: translate(-50%,18px);
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(15,23,42,.92);
    color: #fff;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: .22s ease;
}

    .pd-toast.show {
        transform: translate(-50%,0);
        opacity: 1;
    }

@media (max-width: 980px) {
    .pd-summary {
        grid-template-columns: 110px minmax(0,1fr);
    }

    .pd-cover {
        width: 110px;
        height: 150px;
    }

    .pd-action-panel {
        grid-column: 1 / -1;
    }

    .pd-related-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 640px) {
    .pd-container {
        width: min(100% - 24px,1240px);
    }

    .pd-page {
        padding-top: 12px;
    }

    .pd-summary {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .pd-cover {
        width: 92px;
        height: 126px;
    }

    .pd-cover-title {
        margin-top: 14px;
        font-size: 15px;
    }

    .pd-meta-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .pd-action-panel {
        grid-column: auto;
    }

    .pd-preview-head {
        align-items: flex-start;
    }

    .pd-preview-tools {
        width: 100%;
    }

    .pv-scroll {
        height: 68vh;
        padding: 12px 0 20px;
    }

    .pv-pages {
        gap: 12px;
    }

    .pd-related-grid {
        grid-template-columns: 1fr;
    }

    .pd-preview-title p {
        max-width: 100%;
    }
}
