/* ============ PDF 原样预览查看器（pdf.js 自绘，贴合政文纸感） ============ */
* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    height: 100%;
    background: #f3eedb;
    font-family: "FangSong", "FangSong_GB2312", "STFangsong", "仿宋", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #3f2f14;
}

.pdfv-body {
    display: flex; flex-direction: column;
    height: 100vh;
}

/* 顶栏 */
.pdfv-bar {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    padding: .6rem 1rem;
    background: #faeeda;
    border-bottom: 1px solid #d9c9a4;
    box-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.pdfv-title {
    font-family: "FangSong", "STFangsong", "仿宋", serif;
    color: #854f0b;
    text-decoration: none;
    font-size: .98rem;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pdfv-title:hover { color: #ba7517; }
.pdfv-tools { display: flex; align-items: center; gap: .35rem; }
.pdfv-tools button {
    appearance: none;
    border: 1px solid #d9c9a4;
    background: #fffdf8;
    color: #854f0b;
    font-size: 1.05rem;
    line-height: 1;
    width: 2rem; height: 2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    font-family: inherit;
}
.pdfv-tools button:hover { background: #ba7517; border-color: #ba7517; color: #fff; }
.pdfv-tools button:active { transform: translateY(1px); }
.pdfv-tools button:disabled { opacity: .45; cursor: not-allowed; }

.pdfv-page, .pdfv-zoom {
    display: inline-flex;
    align-items: center; justify-content: center;
    min-width: 5.2rem;
    height: 2rem;
    padding: 0 .6rem;
    background: #fffdf8;
    border: 1px solid #e8dcc0;
    border-radius: 6px;
    font-size: .88rem;
    color: #6b5d3e;
    letter-spacing: 1px;
}
.pdfv-sep {
    width: 1px; height: 1.2rem;
    background: #d9c9a4;
    margin: 0 .3rem;
}

/* 主区 */
.pdfv-main {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    background: #ece4cf;
    scroll-behavior: smooth;
}

/* 状态提示（生成中 / 加载中 / 出错） */
.pdfv-status {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 60vh;
    color: #6b5d3e;
    font-size: .98rem;
}
.pdfv-status p { margin: .8rem 0 0; }
.pdfv-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e8dcc0;
    border-top-color: #ba7517;
    border-radius: 50%;
    animation: pdfv-spin 1s linear infinite;
}
@keyframes pdfv-spin { to { transform: rotate(360deg); } }

/* 页容器 */
.pdfv-pages { max-width: 980px; margin: 0 auto; }
.pdfv-page-wrap {
    background: #fff;
    margin: 0 auto 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(80, 60, 20, .18);
    overflow: hidden;
    position: relative;
}
.pdfv-placeholder {
    display: flex; align-items: center; justify-content: center;
    min-height: 480px;
    color: #b8a87a;
    font-size: .9rem;
}
.pdfv-canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* 滚动条（淡米色） */
.pdfv-main::-webkit-scrollbar { width: 10px; }
.pdfv-main::-webkit-scrollbar-thumb { background: #c8b888; border-radius: 6px; }
.pdfv-main::-webkit-scrollbar-thumb:hover { background: #a8956a; }
.pdfv-main::-webkit-scrollbar-track { background: #ece4cf; }

@media (max-width: 640px) {
    .pdfv-bar { flex-wrap: wrap; gap: .5rem; padding: .5rem .7rem; }
    .pdfv-title { max-width: 100%; font-size: .88rem; }
    .pdfv-tools { width: 100%; justify-content: space-between; }
    .pdfv-page, .pdfv-zoom { min-width: 4.4rem; }
}