

.lpc-app {
    --lpc-primary: #4f46e5;
    --lpc-primary-hover: #4338ca;
    --lpc-primary-soft: #eef2ff;
    --lpc-text: #111827;
    --lpc-text-muted: #6b7280;
    --lpc-border: #e5e7eb;
    --lpc-bg: #ffffff;
    --lpc-bg-soft: #f9fafb;
    --lpc-danger: #ef4444;
    --lpc-danger-soft: #fef2f2;
    --lpc-success: #10b981;
    --lpc-success-soft: #ecfdf5;
    --lpc-warn: #f59e0b;
    --lpc-warn-soft: #fffbeb;
    --lpc-radius: 16px;
    --lpc-radius-sm: 10px;
    --lpc-shadow: 0 1px 3px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);

    max-width: 760px;
    margin: 2em auto;
    padding: 28px;
    background: var(--lpc-bg);
    border: 1px solid var(--lpc-border);
    border-radius: var(--lpc-radius);
    box-shadow: var(--lpc-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--lpc-text);
    font-size: 15px;
    line-height: 1.6;
    box-sizing: border-box;
}
.lpc-app *, .lpc-app *::before, .lpc-app *::after { box-sizing: border-box; }
.lpc-app [hidden] { display: none !important; }

/* Header */
.lpc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.lpc-header-icon {
    flex: 0 0 auto;
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 14px -4px rgba(79,70,229,.5);
}
.lpc-header-icon svg { width: 24px; height: 24px; }
.lpc-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--lpc-text);
}
.lpc-subtitle {
    margin: 2px 0 0;
    font-size: 13.5px;
    color: var(--lpc-text-muted);
}

/* Dropzone */
.lpc-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--lpc-radius);
    background: var(--lpc-bg-soft);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
}
.lpc-dropzone:hover {
    border-color: var(--lpc-primary);
    background: var(--lpc-primary-soft);
}
.lpc-dropzone.is-dragover {
    border-color: var(--lpc-primary);
    background: var(--lpc-primary-soft);
    transform: scale(1.01);
}
.lpc-file-input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}
.lpc-dropzone-icon {
    width: 52px; height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--lpc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lpc-primary);
    transition: transform .25s;
}
.lpc-dropzone:hover .lpc-dropzone-icon,
.lpc-dropzone.is-dragover .lpc-dropzone-icon {
    transform: translateY(-2px);
}
.lpc-dropzone-icon svg { width: 26px; height: 26px; }
.lpc-dropzone-title {
    margin: 0 0 6px;
    font-size: 15px;
    color: var(--lpc-text);
}
.lpc-dropzone-link {
    color: var(--lpc-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.lpc-dropzone-hint {
    margin: 0;
    font-size: 12.5px;
    color: var(--lpc-text-muted);
}

/* Status */
.lpc-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--lpc-radius-sm);
    font-size: 13.5px;
    background: var(--lpc-primary-soft);
    color: #3730a3;
    border: 1px solid #e0e7ff;
}
.lpc-status--success { background: var(--lpc-success-soft); color: #047857; border-color: #d1fae5; }
.lpc-status--error   { background: var(--lpc-danger-soft);  color: #b91c1c; border-color: #fee2e2; }
.lpc-status--warn    { background: var(--lpc-warn-soft);    color: #b45309; border-color: #fef3c7; }

.lpc-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: lpc-spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 2px;
}
@keyframes lpc-spin { to { transform: rotate(360deg); } }

/* File list */
.lpc-filelist {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lpc-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--lpc-border);
    border-radius: var(--lpc-radius-sm);
    transition: border-color .15s, box-shadow .15s;
    animation: lpc-slide-in .25s ease;
}
.lpc-file:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px -4px rgba(79,70,229,.15);
}
@keyframes lpc-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lpc-file-icon {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
}
.lpc-file-icon--docx  { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.lpc-file-icon--xlsx  { background: linear-gradient(135deg, #10b981, #059669); }
.lpc-file-icon--image { background: linear-gradient(135deg, #a855f7, #9333ea); }
.lpc-file-icon--txt   { background: linear-gradient(135deg, #64748b, #475569); }

.lpc-file-info { flex: 1 1 auto; min-width: 0; }
.lpc-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lpc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lpc-file-size {
    font-size: 12px;
    color: var(--lpc-text-muted);
    margin-top: 1px;
}
.lpc-file-remove {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    padding: 0;
}
.lpc-file-remove:hover {
    background: var(--lpc-danger-soft);
    color: var(--lpc-danger);
}

/* Actions */
.lpc-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.lpc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--lpc-radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, color .15s, box-shadow .15s, transform .1s;
    line-height: 1.2;
}
.lpc-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
}
.lpc-btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(79,70,229,.6);
    flex: 1 1 auto;
}
.lpc-btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 20px -8px rgba(79,70,229,.7);
    transform: translateY(-1px);
}
.lpc-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}
.lpc-btn-ghost {
    background: #fff;
    border-color: var(--lpc-border);
    color: var(--lpc-text-muted);
}
.lpc-btn-ghost:hover:not(:disabled) {
    background: var(--lpc-bg-soft);
    border-color: #d1d5db;
    color: var(--lpc-text);
}
.lpc-btn svg { width: 17px; height: 17px; }

/* Progress */
.lpc-progress {
    margin-top: 16px;
    height: 4px;
    border-radius: 4px;
    background: #e0e7ff;
    overflow: hidden;
}
.lpc-progress-bar {
    height: 100%;
    width: 40%;
    border-radius: 4px;
    background: linear-gradient(90deg, #818cf8, #6366f1, #818cf8);
    background-size: 200% 100%;
    animation: lpc-progress 1.2s ease-in-out infinite;
}
@keyframes lpc-progress {
    0%   { transform: translateX(-100%); background-position: 0% 50%; }
    100% { transform: translateX(300%);  background-position: 200% 50%; }
}

/* 隐藏渲染舞台 */
.lpc-render-stage {
    position: fixed;
    left: -99999px;
    top: 0;
    background: #fff;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: -1;
}
.lpc-render-stage--xlsx table {
    border-collapse: collapse;
    width: 100%;
}
.lpc-render-stage--xlsx td,
.lpc-render-stage--xlsx th {
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    font-size: 12px;
    color: #111827;
    vertical-align: top;
}
.lpc-render-stage--xlsx h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

/* 响应式 */
@media (max-width: 600px) {
    .lpc-app { padding: 20px; margin: 1.2em auto; border-radius: 14px; }
    .lpc-dropzone { padding: 28px 14px; }
    .lpc-title { font-size: 18px; }
    .lpc-actions { flex-direction: column; }
    .lpc-btn-primary, .lpc-btn-ghost { width: 100%; }
}
/* ==========================================
   转换结果列表
   ========================================== */
.lpc-results {
    margin-top: 24px;
    border-top: 1px solid var(--lpc-border);
    padding-top: 20px;
}
.lpc-results-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--lpc-text);
}
.lpc-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--lpc-success-soft);
    border: 1px solid #d1fae5;
    border-radius: var(--lpc-radius-sm);
    margin-bottom: 10px;
    animation: lpc-slide-in .25s ease;
}
.lpc-result-icon {
    color: var(--lpc-success);
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}
.lpc-result-info {
    flex: 1;
    min-width: 0;
}
.lpc-result-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--lpc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lpc-result-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}
.lpc-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    height: auto;
    gap: 4px;
}
.lpc-btn-sm svg { width: 14px; height: 14px; }
.lpc-btn-outline {
    background: #fff;
    border: 1px solid var(--lpc-border);
    color: var(--lpc-text);
}
.lpc-btn-outline:hover:not(:disabled) {
    border-color: var(--lpc-primary);
    color: var(--lpc-primary);
}

/* ==========================================
   PDF 预览弹窗 Modal
   ========================================== */
.lpc-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.lpc-modal[hidden] { display: none !important; }
.lpc-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17,24,39,0.7);
    backdrop-filter: blur(3px);
}
.lpc-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}
.lpc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--lpc-border);
    background: #f9fafb;
}
.lpc-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--lpc-text);
}
.lpc-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--lpc-text-muted);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all .15s;
}
.lpc-modal-close:hover {
    background: #e5e7eb;
    color: var(--lpc-text);
}
.lpc-modal-body {
    flex: 1;
    position: relative;
    background: #525659; /* 类似 PDF 阅读器的暗色背景 */
}
.lpc-modal-body iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: none;
}

@media (max-width: 600px) {
    .lpc-result-item { flex-wrap: wrap; }
    .lpc-result-actions { width: 100%; justify-content: flex-end; margin-top: 8px; }
    .lpc-modal { padding: 0; }
    .lpc-modal-dialog { max-height: 100vh; border-radius: 0; }
}
/* 基础变量和布局（保持之前版本不变，这里省略部分重复代码，请直接在原文件最末尾追加以下内容） */
/* 如果你是从头覆盖，请确保包含之前的 .lpc-app 等基础样式 */

/* ====== 新增：设置面板 ====== */
.lpc-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 18px;
    padding: 16px;
    background: var(--lpc-bg-soft);
    border: 1px solid var(--lpc-border);
    border-radius: var(--lpc-radius-sm);
    animation: lpc-slide-in .25s ease;
}
.lpc-setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lpc-setting-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--lpc-text-muted);
}
.lpc-setting-group select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--lpc-border);
    background: var(--lpc-bg);
    color: var(--lpc-text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}
.lpc-setting-group select:focus {
    border-color: var(--lpc-primary);
}
.lpc-checkbox-group {
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed var(--lpc-border);
}
.lpc-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--lpc-text);
    cursor: pointer;
}
.lpc-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--lpc-primary);
}

/* ====== 新增：拖拽排序提示与交互 ====== */
.lpc-sort-hint {
    font-size: 12.5px;
    color: var(--lpc-warn);
    margin: 8px 0 0;
    text-align: center;
}
.lpc-file {
    cursor: grab;
}
.lpc-file:active {
    cursor: grabbing;
}
.lpc-file.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}
.lpc-file.drag-over {
    border-color: var(--lpc-primary);
    border-style: dashed;
    background: var(--lpc-primary-soft);
}

/* ====== 新增：取消按钮和进度文字 ====== */
.lpc-btn-danger {
    background: var(--lpc-danger);
    color: #fff;
    border-color: var(--lpc-danger);
}
.lpc-btn-danger:hover:not(:disabled) {
    background: #dc2626;
}
.lpc-progress {
    position: relative;
    height: 24px; /* 加高以容纳文字 */
    background: var(--lpc-primary-soft);
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lpc-progress-bar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, #818cf8, #6366f1, #818cf8);
    background-size: 200% 100%;
    animation: lpc-progress 1.2s ease-in-out infinite;
    opacity: 0.3;
}
.lpc-progress-text {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--lpc-primary);
}
@keyframes lpc-progress {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ====== 新增：深色模式适配 (Dark Mode) ====== */
@media (prefers-color-scheme: dark) {
    .lpc-app {
        --lpc-primary: #6366f1;
        --lpc-primary-hover: #818cf8;
        --lpc-primary-soft: #312e81;
        --lpc-text: #f3f4f6;
        --lpc-text-muted: #9ca3af;
        --lpc-border: #374151;
        --lpc-bg: #111827;
        --lpc-bg-soft: #1f2937;
        --lpc-danger: #ef4444;
        --lpc-danger-soft: #7f1d1d;
        --lpc-success: #10b981;
        --lpc-success-soft: #064e3b;
        --lpc-warn: #f59e0b;
        --lpc-warn-soft: #78350f;
        --lpc-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
    }
    .lpc-dropzone-icon {
        background: #1f2937;
    }
    .lpc-file {
        background: #1f2937;
    }
    .lpc-file:hover {
        border-color: #4b5563;
        box-shadow: 0 4px 12px -4px rgba(0,0,0,0.5);
    }
    .lpc-file-name { color: #f3f4f6; }
    .lpc-btn-ghost {
        background: #1f2937;
        border-color: #374151;
    }
    .lpc-btn-ghost:hover:not(:disabled) {
        background: #374151;
    }
    /* 隐藏渲染舞台强制白色，不跟随系统深色模式 */
    .lpc-render-stage {
        background: #ffffff !important;
        color: #111827 !important;
    }
}

/* 结果列表的深色模式 */
@media (prefers-color-scheme: dark) {
    .lpc-result-item {
        background: #1f2937;
        border-color: #374151;
    }
    .lpc-result-name { color: #f3f4f6; }
    .lpc-modal-dialog { background: #111827; }
    .lpc-modal-header { background: #1f2937; }
    .lpc-modal-title { color: #f3f4f6; }
    .lpc-modal-close:hover { background: #374151; }
}
/* ====== 新增：密码输入框 ====== */
.lpc-password-group {
    flex: 1 1 200px;
}
.lpc-password-wrap {
    position: relative;
    display: flex;
}
.lpc-password-wrap input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--lpc-border);
    background: var(--lpc-bg);
    color: var(--lpc-text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.lpc-password-wrap input:focus {
    border-color: var(--lpc-primary);
}
.lpc-render-stage {
    margin: 0 !important;
    padding: 0 !important;
}
.lpc-render-stage .docx-wrapper > section.docx {
    box-shadow: none !important;
    margin: 0 !important;
}