/* ========== 附件预览抽屉（全局样式） ========== */
.doc-drawer-body .doc-image-wrap {
    background: var(--bg-secondary, #f7f7f8);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 60vh;
    overflow: auto;
}

.doc-drawer-body .doc-image {
    max-width: 100%;
    max-height: 56vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.doc-drawer-body .doc-content-ocr {
    max-height: none;
}

.doc-drawer-body .doc-ocr-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent, #4f46e5);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-drawer-body .doc-ocr-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary, #1a1a2e);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}
.doc-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.doc-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.doc-drawer {
    position: fixed;
    top: 0;
    right: -580px;
    width: 560px;
    max-width: 92vw;
    height: 100%;
    background: var(--dialog-bg, #ffffff);
    z-index: 10000;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

/* ========== 暗黑模式适配 ========== */
html.dark .doc-drawer {
    background: var(--dialog-bg);
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.5);
}

.doc-drawer.active {
    right: 0;
}

.doc-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e5e5eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.doc-drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-drawer-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-tertiary, #8e8ea0);
    padding: 0 8px;
}

.doc-drawer-close:hover {
    color: var(--text-primary, #1a1a2e);
}

.doc-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.doc-drawer-body .doc-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e5e5eb);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary, #5a5a6e);
}

.doc-drawer-body .doc-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-drawer-body .doc-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary, #1a1a2e);
    background: var(--bg-secondary, #f7f7f8);
    border-radius: 8px;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.doc-drawer-body .doc-content-empty {
    text-align: center;
    color: var(--text-tertiary, #8e8ea0);
    padding: 40px 0;
}

.doc-drawer-body .doc-content-empty i {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.doc-drawer-body .doc-content-empty p {
    margin: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .doc-drawer {
        width: 100%;
        max-width: 100vw;
        right: -100vw;
    }

    .doc-drawer.active {
        right: 0;
    }
}