/* ============================================================
   来源：views/theme/detail.html 内联 <style> 第 1 块（原位抽离，881 行）
   说明：在原位置以 <link rel="stylesheet"> 引入，来源顺序不变，
        层叠结果与抽离前逐字一致，不会引起样式变化。
   ============================================================ */
/* ===== 文档阅读页：隐藏站点页脚与右下角浮动件，避免干扰长文档阅读 =====
   ★页脚片段仍被引入（其脚本承载移动端导航抽屉 / 回到顶部 / 即时消息），
   这里只隐藏视觉部分，不影响脚本与导航逻辑。 */
footer,
.back-to-top,
.im-global-btn,
.im-mini {
    display: none !important;
}

/* ===== 覆盖公共样式以优化阅读器 ===== */
.article-main {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    height: auto !important;
    min-height: 480px;
    /* ★★2026-10-06：不参与 flex 行的拉伸。
       原来 .article-layout 默认 align-items:stretch，而右栏「文档信息」卡很长（实测侧栏 1704px），
       于是 .article-main 被拉到 1704px，里面的阅读区（flex:1）跟着变成 1337px ——
       而 A4 纸只有 1048px，纸下面空出 253px 灰底，正是「空白 / 多余的内容」的来源。
       改成 flex-start 后，阅读区高度 = 当前文档页高度（PDF 即 A4 等比），纸下不再有空白。 */
    align-self: flex-start;
}

.doc-content-wrapper {
    /* ★★2026-10-06：由 flex:1 改为 0 0 auto —— 阅读区**不再参与拉伸**。
       配合 adjustHeights 用 min-height 把左栏卡片拉到与右栏等高：
       多出来的空间会留在卡片底部，而不是把阅读区（灰底）撑高、在 A4 纸下面留出一片空白。 */
    flex: 0 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px 16px;
    /* 文库式阅读器底色：灰色衬底 + 白色纸张，突出文档主体 */
    background: #eef1f5;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #d0d7e0 #f0f2f5;
    height: 100%;
    scroll-behavior: smooth;
}

.doc-content-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.doc-content-wrapper::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 8px;
}

.doc-content-wrapper::-webkit-scrollbar-thumb {
    background: #d0d7e0;
    border-radius: 8px;
}

.doc-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #b0b8c4;
}

#docPages {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.doc-page {
    display: block;
    max-width: 820px;
    margin: 0 auto 18px;
    padding: 40px 48px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(20, 30, 50, 0.10);
    line-height: 1.95;
    font-size: 1rem;
    color: #2b3441;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 1123px;
    position: relative;
}

.doc-page:last-child {
    margin-bottom: 0;
}

/* DOC/DOCX/MD 按内容分页，不应强制撑成整页高度（避免大量空白、滚动费力） */
.doc-page:not(.pdf-page) {
    min-height: auto;
}

.doc-page h1, .doc-page h2, .doc-page h3,
.doc-page h4, .doc-page h5, .doc-page h6 {
    margin: 1.1em 0 0.5em;
    font-weight: 700;
    line-height: 1.35;
    color: #15233b;
}

.doc-page h1 {
    font-size: 1.7rem;
    border-left: 4px solid #eb1313;
    padding-left: 12px;
}

.doc-page h2 {
    font-size: 1.45rem;
    border-left: 4px solid #eb1313;
    padding-left: 10px;
}

.doc-page h3 {
    font-size: 1.2rem;
}

.doc-page h4 {
    font-size: 1.08rem;
}

.doc-page h5 {
    font-size: 1rem;
}

.doc-page h6 {
    font-size: 0.92rem;
    color: #5a6b7c;
}

.doc-page p {
    margin: 0.6em 0;
}

.doc-page img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.doc-page table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.8em 0;
}

.doc-page th, .doc-page td {
    border: 1px solid #dce0e6;
    padding: 6px 10px;
    text-align: left;
}

.doc-page th {
    background: #fbeee2;
}

/* ===== 文档正文（docx / doc / md 解析结果）渲染规范 =====
   与「专题文档转换规则」对齐：宋体正文、深红标题、奶白表头、全框线表格。
   注意：解析器输出的行内样式（字体 / 字号 / 颜色 / 对齐）优先级高于这里的类规则，
   即文档自身的排版会覆盖本区块默认值——这正是「与 doc 一致」的要求。 */
.doc-page {
    font-family: "宋体", SimSun, "Songti SC", "Microsoft YaHei", serif;
}

.doc-page .doc-table {
    table-layout: auto;
}

.doc-page .doc-table th,
.doc-page .doc-table td {
    vertical-align: top;
    line-height: 1.6;
    word-break: break-word;
}

.doc-page .doc-table th {
    font-weight: 700;
    text-align: center;
}

/* 目录条目：文字 + 点线 + 右对齐页码（来自文档自带的 TOC 域结果） */
.doc-page .doc-toc-line {
    display: flex;
    align-items: baseline;
    gap: .4em;
    margin: .3em 0;
    font-size: .95rem;
    color: #333;
}

.doc-page .doc-toc-line .doc-toc-text {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-page .doc-toc-line .doc-toc-dots {
    flex: 1 1 auto;
    min-width: 1.5em;
    border-bottom: 1px dotted #c3c9d2;
    transform: translateY(-.35em);
}

.doc-page .doc-toc-line .doc-toc-page {
    flex: 0 0 auto;
    color: #5a6b7c;
    font-variant-numeric: tabular-nums;
}

/* 正文里的制表符（干支表 / 命盘对齐依赖它） */
.doc-page .doc-tab {
    display: inline-block;
    min-width: 1.6em;
}

/* PDF 提取出来的纯文本 */
.doc-page .doc-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Times New Roman", "宋体", serif;
    font-size: .95rem;
    line-height: 1.8;
}

@keyframes fadeIn {
    from {
        opacity: 0.6;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.doc-placeholder .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.doc-placeholder .sub {
    font-size: 0.85rem;
    color: #b0b8c4;
}

/* PDF iframe */
.doc-preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
    display: block;
    background: #ffffff;
}

#docPages:has(.doc-preview-iframe) {
    min-height: 600px;
    height: 100%;
    position: relative;
}

/* ===== 底部固定栏 ===== */
.doc-bottom-bar {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid #eef0f2;
    padding: 6px 20px 8px;
    border-radius: 0 0 10px 10px;
}

.doc-bottom-bar .next-links {
    display: flex;
    justify-content: space-between;
    padding: 6px 0 4px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 6px;
}

.doc-bottom-bar .next-links a {
    color: #2d7eff;
    text-decoration: none;
    font-size: 0.85rem;
    max-width: 46%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 8px;
    border-radius: 4px;
}

.doc-bottom-bar .next-links a:hover {
    background: #f0f5ff;
    text-decoration: underline;
}

.doc-bottom-bar .next-links .disabled {
    color: #b0b8c4;
    cursor: default;
    text-decoration: none;
}

.doc-download-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    min-height: 48px;
}

/* 左侧元数据 */
.doc-meta-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 0.7rem;
    color: #7a8a9e;
}

.doc-meta-tags .tag-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f0f2f5;
    padding: 0 8px;
    border-radius: 12px;
    line-height: 22px;
    color: #5a6b7c;
    white-space: nowrap;
}

.doc-meta-tags .tag-item .num {
    color: #1f2a3a;
    font-weight: 500;
}

/* 中间页码导航 */
.page-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #1f2a3a;
    flex-wrap: wrap;
}

.page-nav .page-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #dce0e6;
    background: #fff;
    color: #1f2a3a;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

.page-nav .page-arrow:hover:not(.disabled) {
    background: #f0f2f5;
    border-color: #b0b8c4;
}

.page-nav .page-arrow.disabled {
    color: #b0b8c4;
    cursor: not-allowed;
    background: #f8f9fa;
}

.page-nav .page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 4px;
    border-radius: 4px;
    border: 1px solid transparent;
    color: #1f2a3a;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, border-color 0.2s;
}

.page-nav .page-number:hover:not(.active) {
    background: #f0f2f5;
    border-color: #dce0e6;
}

.page-nav .page-number.active {
    background: #eb1313;
    color: #fff;
    border-color: #eb1313;
    cursor: default;
}

/* ★试读范围之外的页码：淡一档并带 🔒 角标，让未授权用户一眼看出「从此页起需登录/购买」 */
.page-nav .page-number.locked {
    color: #b8b2ab;
}
.page-nav .page-number.locked:hover:not(.active) {
    color: #8f8880;
}
.page-nav .page-lock {
    font-size: 0.6rem;
    font-style: normal;
    line-height: 1;
    margin-left: 2px;
    opacity: 0.8;
}

.page-nav .page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.page-nav .page-total {
    margin-left: 8px;
    color: #7a8a9e;
    font-size: 0.85rem;
}

.page-nav .page-total .num {
    color: #1f2a3a;
    font-weight: 500;
}

/* ===== 页码跳转区域 ===== */
.page-jump {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    font-size: 0.85rem;
    color: #1f2a3a;
}

.page-jump .jump-label {
    color: #7a8a9e;
}

.page-jump #pageJumpInput {
    width: 48px;
    height: 28px;
    border: 1px solid #dce0e6;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
    padding: 0 4px;
    outline: none;
    transition: border-color 0.2s;
}

.page-jump #pageJumpInput:focus {
    border-color: #409eff;
}

.page-jump #pageJumpInput::-webkit-outer-spin-button,
.page-jump #pageJumpInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-jump #pageJumpInput[type=number] {
    -moz-appearance: textfield;
}

/* ===== 跳转按钮 - 与主题红色一致 ===== */
.page-jump .jump-btn {
    height: 28px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    background: #eb1313;
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s ease;
    line-height: 28px;
    white-space: nowrap;
}

.page-jump .jump-btn:hover {
    background: #c40e0e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 19, 19, 0.35);
}

.page-jump .jump-btn:active {
    transform: translateY(0);
}

/* 右侧操作按钮
   ★ 尺寸对齐全站 pill 按钮（common.css 的 .like-btn / .collect-btn：
     padding 6px 18px、font-size .95rem、border-radius 30px、gap 8px），
     只把 line-height 收到 20px —— 整体高度由 42px 降到 34px，
     与同一栏里 28px 的翻页箭头/跳转按钮观感一致。
     三颗按钮（点赞 / 收藏 / 下载）都从这里取尺寸，且等高。 */
.doc-download-bar .action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.doc-download-bar .action-group .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 18px;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    transition: 0.2s;
    background: #f0f2f5;
    color: #1f2a3a;
}

.doc-download-bar .action-group .action-btn:hover {
    background: #dce0e6;
}

.doc-download-bar .action-group .action-btn.download-btn {
    background: #eb1313;
    color: #fff;
    font-size: 0.95rem;
    padding: 6px 20px;
    line-height: 20px;
}

.doc-download-bar .action-group .action-btn.download-btn:hover {
    background: #c40e0e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 19, 19, 0.35);
}

.doc-download-bar .action-group .action-btn.download-btn:active {
    transform: translateY(0);
}

.doc-download-bar .action-group .action-btn .badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    line-height: 18px;
}

.doc-download-bar .action-group .action-btn.like-btn {
    background: none;
    border: 1px solid #e0d8d0;
    padding: 5px 17px;          /* 补回 1px 边框，保证与实底按钮等高 34px */
}

.doc-download-bar .action-group .action-btn.like-btn:hover {
    border-color: #eb1313;
    color: #eb1313;
    background: #feeeee;
}

.doc-download-bar .action-group .action-btn.like-btn.liked {
    border-color: #eb1313;
    background: #feeeee;
    color: #eb1313;
}

.doc-download-bar .action-group .action-btn.collect-btn {
    background: none;
    border: 1px solid #e0d8d0;
    padding: 5px 17px;          /* 同 .like-btn：补回 1px 边框，与实底按钮等高 34px */
}

.doc-download-bar .action-group .action-btn.collect-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #fef7e6;
}

.doc-download-bar .action-group .action-btn.collect-btn.collected {
    border-color: #f59e0b;
    background: #fef7e6;
    color: #f59e0b;
    cursor: default;
}

.doc-download-bar .action-group .action-btn.collect-btn.collected:hover {
    background: #fef7e6;
    border-color: #f59e0b;
    color: #f59e0b;
}

/* 下载按钮"已下载"状态（仅文字变化，不禁用） */
.doc-download-bar .action-group .action-btn.download-btn.is-down {
    background: #6b7280;
    /* 不设置 cursor: default，保持可点击 */
}

.doc-download-bar .action-group .action-btn.download-btn.is-down:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.35);
}

/* 隐藏所有提示文字（点赞、收藏） */
#likeTip, #collectTip {
    display: none !important;
}

/* ===== 收藏弹窗（与文章详情一致） ===== */
.collect-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease;
}

.collect-modal-overlay.open {
    display: flex;
}

.collect-modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    width: 440px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: scaleIn 0.2s ease;
}

.collect-modal-card .modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #2c2b28;
}

.collect-modal-card .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}

.collect-modal-card .modal-close:hover {
    color: #333;
}

.collect-modal-card .folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0ebe6;
}

.collect-modal-card .folder-item:hover {
    background: #feeeee;
}

.collect-modal-card .folder-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #eb1313;
    flex-shrink: 0;
}

.collect-modal-card .folder-item .folder-name {
    font-size: 0.95rem;
    color: #2c2b28;
}

.collect-modal-card .folder-item .folder-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #94a3b8;
}

.collect-modal-card .empty-tip {
    padding: 20px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
}

.collect-modal-card .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0ebe6;
}

.collect-modal-card .modal-actions .btn {
    padding: 6px 24px;
    border-radius: 30px;
    border: 1px solid #e0d8d0;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.collect-modal-card .modal-actions .btn:hover {
    border-color: #eb1313;
    color: #eb1313;
    background: #feeeee;
}

.collect-modal-card .modal-actions .btn-primary {
    background: #eb1313;
    color: #fff;
    border-color: #eb1313;
}

.collect-modal-card .modal-actions .btn-primary:hover {
    background: #c40e0e;
    border-color: #c40e0e;
    color: #fff;
}

.collect-modal-card .modal-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================ */
/* ===== 新增：Element UI 风格 Message 提示框 ===== */
.custom-message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.custom-message {
    pointer-events: auto;
    padding: 12px 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #ebeef5;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #303133;
    animation: messageFadeIn 0.3s ease;
    min-width: 200px;
    max-width: 80vw;
}

.custom-message .msg-icon {
    font-size: 18px;
}

.custom-message.success {
    border-left: 4px solid #67c23a;
    background: #f0f9eb;
    color: #67c23a;
}

.custom-message.success .msg-icon {
    color: #67c23a;
}

.custom-message .msg-text {
    flex: 1;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes messageFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* ============================================================
   ===== 会员专属文档「确认下载」弹窗 =====
   只在 priceType=3 且未下载过的文档上出现，提示
   「可用免费次数（会员赠送剩余）」+「购买次数（下载次数包剩余）」。
   视觉沿用收藏弹窗（白卡 16px 圆角 + 12/0.12 阴影 + 红色主按钮）。
   ============================================================ */
.dl-confirm-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.dl-confirm-mask.open {
    display: flex;
}

.dl-confirm-card {
    position: relative;
    width: 420px;
    max-width: 92vw;
    background: #fff;
    border-radius: 16px;
    padding: 24px 26px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease;
}

.dl-confirm-card .dl-confirm-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
}

.dl-confirm-card .dl-confirm-close:hover {
    color: #333;
}

.dl-confirm-card .dl-confirm-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: #2c2b28;
    margin-bottom: 8px;
}

.dl-confirm-card .dl-confirm-tip {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #8a8f98;
    margin-bottom: 16px;
}

.dl-quota-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dl-quota-item {
    background: #faf6f2;
    border: 1px solid #f0e7dd;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
}

.dl-quota-item .k {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 4px;
}

.dl-quota-item .v {
    font-size: 0.82rem;
    color: #6b6259;
}

.dl-quota-item .v b {
    font-size: 1.28rem;
    color: #eb1313;
    font-weight: 700;
    margin-right: 2px;
}

.dl-quota-item .s {
    font-size: 0.7rem;
    color: #b3aa9f;
    margin-top: 4px;
    line-height: 1.5;
}

.dl-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0ebe6;
}

.dl-confirm-actions .dl-confirm-btn {
    padding: 6px 22px;
    border-radius: 30px;
    border: 1px solid #e0d8d0;
    background: #fff;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.dl-confirm-actions .dl-confirm-btn:hover {
    border-color: #eb1313;
    color: #eb1313;
    background: #feeeee;
}

.dl-confirm-actions .dl-confirm-btn.primary {
    background: #eb1313;
    border-color: #eb1313;
    color: #fff;
}

.dl-confirm-actions .dl-confirm-btn.primary:hover {
    background: #c40e0e;
    border-color: #c40e0e;
    color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
    .article-main {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .doc-content-wrapper {
        max-height: 500px;
        height: auto !important;
        padding: 12px 16px;
    }

    .doc-bottom-bar {
        padding: 6px 12px 8px;
    }

    .doc-download-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .doc-meta-tags {
        justify-content: flex-start;
    }

    .page-nav {
        justify-content: flex-start;
        gap: 2px;
    }

    .page-nav .page-number {
        min-width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .page-nav .page-arrow {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .page-nav .page-total {
        margin-left: 4px;
        font-size: 0.8rem;
    }

    .page-jump {
        margin-left: 4px;
        flex-wrap: wrap;
        gap: 2px;
    }

    .page-jump #pageJumpInput {
        width: 40px;
        height: 24px;
        font-size: 0.75rem;
    }

    .page-jump .jump-btn {
        height: 24px;
        padding: 0 10px;
        font-size: 0.72rem;
        line-height: 24px;
    }

    .page-jump .jump-label {
        font-size: 0.75rem;
    }

    .doc-download-bar .action-group {
        justify-content: flex-start;
    }

    .doc-page {
        padding: 16px 18px;
        min-height: 400px;
    }

    #docPages:has(.doc-preview-iframe) {
        min-height: 400px;
    }

    .doc-bottom-bar .next-links {
        flex-wrap: wrap;
        gap: 4px;
    }

    .doc-bottom-bar .next-links a {
        max-width: 100%;
        white-space: normal;
    }

    .collect-modal-card {
        padding: 20px;
        width: 95vw;
    }
}

@media (max-width: 640px) {
    .doc-content-wrapper {
        padding: 8px 10px;
        min-height: 160px;
    }

    .doc-page {
        font-size: 0.88rem;
        padding: 12px 14px;
        min-height: 300px;
    }

    .doc-meta-tags .tag-item {
        font-size: 0.6rem;
        line-height: 18px;
        padding: 0 6px;
    }

    #docPages:has(.doc-preview-iframe) {
        min-height: 300px;
    }

    .doc-download-bar .action-group .action-btn.download-btn {
        font-size: 0.88rem;
        padding: 4px 14px;
        line-height: 18px;
    }

    .page-nav .page-number {
        min-width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .page-nav .page-arrow {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .page-nav .page-total {
        font-size: 0.75rem;
    }

    .page-jump {
        margin-left: 2px;
        gap: 2px;
    }

    .page-jump #pageJumpInput {
        width: 36px;
        height: 22px;
        font-size: 0.7rem;
    }

    .page-jump .jump-btn {
        height: 22px;
        padding: 0 8px;
        font-size: 0.65rem;
        line-height: 22px;
    }

    .page-jump .jump-label {
        font-size: 0.7rem;
    }
}

/* ============================================================================
   ★价格行「状态化」样式（2026-10-05）
   文档信息面板里的「价格」：默认是 amber 实心徽标（原价）。
   当用户**无需再付费**时（会员免费额度 / 次数包额度 / 已获取），服务端给 .struck：
   按电商习惯改成「灰色原价 + 删除线」，右侧再挂一枚绿色小提示说明原因。
   ★放 detail.css（带 ?v=）而不是共享的 theme.css（不带 ?v=），避免改了样式浏览器不刷新。
   ============================================================================ */
.doc-info-grid .value .price-badge.struck {
    background: transparent;
    color: #98a2b3;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: line-through;
}

.doc-info-grid .value .price-hint {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #10b981;
    font-size: 0.72rem;
    font-weight: 500;
    vertical-align: middle;
    white-space: nowrap;
}

/* ============================================================================
   ★作者信息（2026-10-06）
   1) 底部操作栏原来的「➕ 关注作者」按钮改成**作者名称**展示（.author-chip）——
      光写「关注作者」用户看不出关注的是谁；关注按钮移到右侧文档信息卡的作者行。
   2) 文档信息卡新增「作者」行：名字 + 关注按钮同行（.value-author / .follow-inline-btn）。
   ============================================================================ */
.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 160px;
    padding: 5px 12px;
    border: 1px solid #eef0f2;
    border-radius: 20px;
    background: #fafbfc;
    color: #2c3b4e;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-info-grid .value-author {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.doc-info-grid .value-author .author-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #b3261e;
}

/* 关注按钮：小号描边按钮，与侧栏文档信息行高对齐 */
.follow-inline-btn {
    flex: 0 0 auto;
    padding: 2px 9px;
    border: 1px solid #eb1313;
    border-radius: 999px;
    background: #fff;
    color: #eb1313;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.6;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.follow-inline-btn:hover { background: #fff2f2; }
.follow-inline-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================================
   ★会员套餐弹框的「未挂载」保护（2026-10-06）
   #vipApp 里的 DOM 来自 fragments/vip-modal（含 v-for / {{ }} 插值），
   Vue 挂载前必须隐藏，否则用户会看到一坨模板原文。
   （会员中心等 Vue 页面用的是全局 [v-cloak] 规则，本页没有引入那份 CSS，这里就地补一条。）
   ============================================================================ */
#vipApp[v-cloak] { display: none; }

/* ============================================================================
   ★头部「拍平」+ 元信息行（2026-10-06）
   用户反馈：标题下面那一片（📅 日期 / 📁 格式 / 💰 价格 / 👁️ 查看 一行）下方有一条分隔下划线，
   整块还带 32px 大圆角与卡片边框，占高又"不像阅读页"。在**页面级**样式里覆盖
   （common.css 的 .article-card/.article-header 是文章/论坛详情共用的，改那里会波及别的页面）：
     · 去掉 .article-header 的 border-bottom（那条"下划线"）与其 20px 下内边距、28px 下外边距
     · 去掉头部卡片的大圆角、边框、内边距，让标题区与外层 .article-main 融为一体
   ============================================================================ */
.article-card#headerCard {
    border: none;
    border-radius: 0;
    padding: 14px 20px 2px;
    margin-bottom: 0;
    background: transparent;
}

.article-card#headerCard .breadcrumb {
    margin: 0 0 8px;
    font-size: 0.8rem;
}

.article-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.article-card#headerCard .article-title {
    font-size: 1.5rem;
    margin: 6px 0 8px;
}

.article-card#headerCard .article-meta {
    gap: 16px;
    font-size: 0.78rem;
}

/* 元信息行里的操作按钮（私信）：与文字元信息同高，不做成大圆角按钮 */
.meta-action-btn {
    border: none;
    background: none;
    padding: 0;
    color: #2d7eff;
    font-size: 0.78rem;
    cursor: pointer;
    line-height: 1.4;
}
.meta-action-btn:hover { text-decoration: underline; }

/* 元信息行里的作者：复用 .author-chip 的语义，但这里要紧凑、不带"按钮感" */
.article-card#headerCard .article-meta .author-chip {
    padding: 0;
    border: none;
    background: none;
    max-width: none;
    font-size: 0.78rem;
    color: #b3261e;
    font-weight: 600;
}

/* ============================================================================
   ★右侧列表「禁止换行」（2026-10-06）
   用户反馈：相关文章的列表会换行 ⇒ 右栏高度随内容变化，左右两栏就对不齐。
   这里把侧栏各列表项强制成**恒定的两行**（标题一行 + 元信息一行），
   超长标题一律走省略号，不再折行 ⇒ 模块高度可预测，左栏 min-height 才谈得上"精确等高"。
   ★放页面级 detail.css（带 ?v=）而不是共享 theme.css（不带 ?v=，改了浏览器可能吃缓存）。
   ============================================================================ */
#articleSidebar .latest-list .doc-item {
    flex-wrap: nowrap;
    overflow: hidden;
}

/* flex 子项必须 min-width:0，否则长标题会把容器顶宽、text-overflow 省略号不生效 */
#articleSidebar .latest-list .doc-item .doc-info {
    min-width: 0;
}

#articleSidebar .latest-list .doc-item .doc-info .doc-title {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 元信息行（📅 日期 / 👁️ 浏览量 / 页数 / 价格…）：同样只占一行，超出部分裁掉 */
#articleSidebar .latest-list .doc-item .doc-meta-sm {
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
}

/* ============================================================================
   ★「相关文章」一条一行（2026-10-06 二次调整）
   上一版只保证「标题不折行」，但每条仍是**两行**（标题一行 + 元信息一行），
   用户反馈「列表还是换行了，要一行显示」。这里把 ul 加 `.one-line` 后，
   条目内部改成 flex 横排：`📄 标题 ……… 日期 浏览量`，超长标题走省略号。
   ★必须给 .doc-title 加 min-width:0，否则 flex 子项按 min-content 撑开、省略号不生效。
   ============================================================================ */
#articleSidebar .latest-list.one-line .doc-item {
    align-items: center;
    padding: 7px 0;
}

#articleSidebar .latest-list.one-line .doc-item .doc-icon-sm {
    margin-top: 0;
    font-size: 1rem;
    width: 22px;
}

#articleSidebar .latest-list.one-line .doc-item .doc-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

#articleSidebar .latest-list.one-line .doc-item .doc-info .doc-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.85rem;
}

#articleSidebar .latest-list.one-line .doc-item .doc-info .doc-meta-sm {
    flex: 0 0 auto;
    margin-top: 0;
    gap: 8px;
    font-size: 0.68rem;
}

/* ============================================================================
   ★「文档信息」卡 · 评分行（2026-10-06 新增）
   文档质量评分系统在详情页的落点：可点星打分/改分，悬浮预览、点击提交。
   ★`.dr-*` 的样式原本只写在 board.css（板块页专用），详情页不加载那个文件 ⇒ 这里补一份精简版。
   ============================================================================ */
.doc-info-grid .value-rating {
    display: flex;
    align-items: center;
    min-width: 0;
}

.doc-info-grid .value-rating .doc-rating-card {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
}

.doc-info-grid .value-rating .dr-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
}

.doc-info-grid .value-rating .dr-stars {
    flex: 0 0 auto;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
}

.doc-info-grid .value-rating .dr-stars.busy {
    opacity: .55;
    pointer-events: none;
}

.doc-info-grid .value-rating .dr-star {
    display: inline-block;
    font-size: 1rem;
    color: #dcdfe6;
    transition: color .12s, transform .12s;
}

.doc-info-grid .value-rating .dr-star.on {
    color: #f7b500;
}

.doc-info-grid .value-rating .dr-stars:not(.busy) .dr-star:hover {
    transform: scale(1.12);
}

.doc-info-grid .value-rating .dr-summary {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.72rem;
    color: #667085;
    white-space: nowrap;
}

.doc-info-grid .value-rating .dr-avg {
    color: #eb1313;
    font-weight: 700;
    font-size: 0.85rem;
}

.doc-info-grid .value-rating .dr-count {
    color: #98a2b3;
}

/* ============================================================================
   ★底部栏：翻页 与 点赞/收藏/下载 必须**同一行**（2026-10-06）
   原来 `.doc-download-bar` 是 `flex-wrap: wrap`，其子项宽度和 ≈ 804px 而容器只有 749px，
   于是「操作按钮组」被挤到第二行、还左对齐贴边 —— 用户看到的就是「不在一行」。
   处理：① 容器不换行；② 页码区可压缩（flex:1 1 auto + min-width:0）；
        ③ 操作按钮组不参与压缩；④ 跳页控件去掉文字标签 + 收紧内边距（见 detail.html）。
   ★窗口很窄时（<1080px）再退回两行：宁可换行，也不能把页码/按钮裁掉。
   ============================================================================ */
.doc-download-bar {
    flex-wrap: nowrap;
    gap: 6px 10px;
}

.doc-download-bar .page-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.doc-download-bar .action-group {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
}

.doc-download-bar .action-group .action-btn {
    padding: 6px 13px;
    font-size: 0.9rem;
    gap: 6px;
}

.doc-download-bar .action-group .action-btn.download-btn {
    padding: 6px 14px;
}

.page-nav .page-total {
    margin-left: 4px;
    white-space: nowrap;
}

.page-nav .page-number,
.page-nav .page-ellipsis {
    min-width: 26px;
}

.page-jump {
    margin-left: 8px;
}

.page-jump #pageJumpInput {
    width: 46px;
}

.page-jump .jump-btn {
    padding: 0 12px;
}

@media (max-width: 1080px) {
    .doc-download-bar {
        flex-wrap: wrap;
    }
    .doc-download-bar .page-nav {
        flex: 1 1 100%;
    }
}

/* ============================================================
   文档连续滚动阅读（2026-10-06）
   ------------------------------------------------------------
   首屏并发铺 5 页，之后滚动到底自动续拉。需要的三个元素：
     .doc-scroll-sentinel  触底哨兵（1px 高的探测点，JS 往里塞加载中/结束文案）
     .doc-loading-more     「正在加载第 N 页…」提示
     .doc-end-mark         「已读完 N 页」结束标记
   ============================================================ */
.doc-scroll-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1px;
}

.doc-loading-more {
    padding: 18px 0;
    text-align: center;
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
    /* 轻微呼吸动画，提示「正在加载」而不是「卡住了」 */
    animation: doc-loading-pulse 1.2s ease-in-out infinite;
}

@keyframes doc-loading-pulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}

/* 付费墙作为独立页插入时，与普通页保持间距 */
.doc-paywall-page {
    margin-top: 12px;
}
