:root {
    --pdf-bg: #eff6ff;
    --pdf-card: #ffffff;
    --pdf-text: #1f2937;
    --pdf-title: #111827;
    --pdf-soft: #6b7280;
    --pdf-line: #dbeafe;
    --pdf-line-deep: #bfd7ff;
    --pdf-primary: #2563eb;
    --pdf-primary-dark: #1d4ed8;
    --pdf-primary-soft: #eff6ff;
    --pdf-success-bg: #f0fdf4;
    --pdf-success-text: #166534;
    --pdf-error-bg: #fef2f2;
    --pdf-error-text: #b91c1c;
    --pdf-warning-bg: #fff7ed;
    --pdf-warning-text: #c2410c;
    --pdf-neutral-bg: #f8fbff;
    --pdf-file-bg: #f6fbf8;
    --pdf-file-border: #e3efe8;
    --pdf-file-name: #415b4e;
    --pdf-file-size: #7c9388;
    --pdf-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --pdf-radius: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    background: var(--pdf-bg);
    color: var(--pdf-text);
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

a {
    text-decoration: none;
}

.pdf-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.pdf-container {
    width: 100%;
    max-width: 980px;
}

.pdf-card {
    background: var(--pdf-card);
    border-radius: var(--pdf-radius);
    box-shadow: var(--pdf-shadow);
    padding: 28px;
}

.pdf-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.pdf-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.pdf-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pdf-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.pdf-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--pdf-text);
    letter-spacing: 0.5px;
}

.pdf-back-link {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.pdf-back-link:hover {
    color: var(--pdf-primary);
}

.pdf-hero {
    text-align: center;
}

.pdf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--pdf-primary-soft);
    color: var(--pdf-primary);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--pdf-line);
}

.pdf-title {
    margin: 16px 0 0;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--pdf-title);
}

.pdf-subtitle {
    max-width: 700px;
    margin: 10px auto 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--pdf-soft);
}

.pdf-trust-row {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pdf-trust-item {
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid var(--pdf-line);
    padding: 16px 18px;
}

.pdf-trust-label {
    font-size: 12px;
    color: var(--pdf-soft);
}

.pdf-trust-value {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--pdf-text);
}

.pdf-tool-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pdf-tool-card {
    width: 100%;
    text-align: left;
    border: 1px solid #e5edf8;
    background: #ffffff;
    border-radius: 22px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.04);
}

.pdf-tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--pdf-line-deep);
    box-shadow: 0 16px 24px -10px rgba(15, 23, 42, 0.08);
}

.pdf-tool-card.active {
    background: #f8fbff;
    border-color: var(--pdf-primary);
    box-shadow: 0 12px 28px -12px rgba(37, 99, 235, 0.32);
}

.pdf-tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    font-size: 24px;
    margin-bottom: 14px;
}

.pdf-tool-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pdf-tool-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--pdf-text);
}

.pdf-tool-tag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.pdf-tool-tag-live {
    background: #eff6ff;
    color: var(--pdf-primary);
}

.pdf-tool-desc {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--pdf-soft);
    min-height: 76px;
}

.pdf-tool-link {
    display: inline-flex;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--pdf-primary);
}

.pdf-workbench {
    margin-top: 24px;
    border: 1px solid var(--pdf-line);
    border-radius: 22px;
    background: var(--pdf-neutral-bg);
    padding: 22px;
}

.pdf-workbench-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.pdf-section-kicker {
    font-size: 12px;
    font-weight: 700;
    color: var(--pdf-primary);
    letter-spacing: 0.4px;
}

.pdf-section-title {
    margin: 6px 0 0;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--pdf-title);
}

.pdf-section-desc {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--pdf-soft);
    max-width: 620px;
}

.pdf-current-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--pdf-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.45);
}

.pdf-merge-shell {
    margin-top: 20px;
}

.pdf-dropzone {
    margin-top: 6px;
    border: 2px dashed #bfd7ff;
    border-radius: 20px;
    background: #f8fbff;
    padding: 34px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pdf-dropzone:hover,
.pdf-dropzone.dragover {
    background: #eef6ff;
    border-color: var(--pdf-primary);
}

.pdf-dropzone-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.pdf-dropzone-text {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.pdf-dropzone-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--pdf-soft);
    line-height: 1.7;
}

.pdf-action-area {
    margin-top: 16px;
    margin-bottom: 14px;
    display: grid;
    gap: 12px;
}

.pdf-stats {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

.pdf-btn-primary,
.pdf-btn-secondary,
.pdf-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    box-sizing: border-box;
    border: 0;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pdf-btn-primary {
    background: var(--pdf-primary);
    color: #fff;
}

.pdf-btn-primary:hover {
    background: var(--pdf-primary-dark);
    transform: translateY(-1px);
}

.pdf-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    transform: none;
}

.pdf-btn-secondary {
    background: var(--pdf-primary-soft);
    color: var(--pdf-primary-dark);
}

.pdf-btn-secondary:hover {
    background: var(--pdf-line);
    transform: translateY(-1px);
}

.pdf-btn-ghost {
    background: #eef2ff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
    padding: 0 14px;
}

.pdf-btn-ghost:hover {
    background: #e2e8f0;
}

.pdf-action-btn {
    width: 100%;
}

.pdf-file-list {
    margin-top: 0;
    display: grid;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.pdf-file-list::-webkit-scrollbar {
    width: 8px;
}

.pdf-file-list::-webkit-scrollbar-thumb {
    background: #dbe7df;
    border-radius: 999px;
}

.pdf-file-list::-webkit-scrollbar-track {
    background: transparent;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--pdf-file-bg);
    border: 1px solid var(--pdf-file-border);
}

.pdf-file-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.pdf-file-order {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #e0ecff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.pdf-file-meta {
    min-width: 0;
}

.pdf-file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pdf-file-name);
    word-break: break-all;
}

.pdf-file-size {
    margin-top: 4px;
    font-size: 12px;
    color: var(--pdf-file-size);
}

.pdf-file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pdf-file-remove {
    border: 0;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.pdf-file-remove:hover {
    background: #fecaca;
}

.pdf-progress {
    margin-top: 18px;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.pdf-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.25s ease;
}

.pdf-result {
    margin-top: 18px;
}

.pdf-alert {
    border-radius: 16px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.pdf-alert-success {
    background: var(--pdf-success-bg);
    color: var(--pdf-success-text);
    border: 1px solid #bbf7d0;
}

.pdf-alert-error {
    background: var(--pdf-error-bg);
    color: var(--pdf-error-text);
    border: 1px solid #fecaca;
}

.pdf-alert-warning {
    background: var(--pdf-warning-bg);
    color: var(--pdf-warning-text);
    border: 1px solid #fdba74;
}

.pdf-result-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.pdf-result-actions .pdf-btn-primary,
.pdf-result-actions .pdf-btn-secondary {
    margin: 0;
}

.pdf-result-list {
    margin-top: 12px;
    padding-left: 18px;
}

.pdf-placeholder {
    margin-top: 20px;
    display: grid;
    gap: 14px;
}

.pdf-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pdf-info-panel {
    background: #fff;
    border: 1px solid #e6eefc;
    border-radius: 18px;
    padding: 18px;
}

.pdf-panel-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    color: var(--pdf-text);
}

.pdf-list {
    margin: 0;
    padding-left: 18px;
    color: var(--pdf-soft);
}

.pdf-list li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.pdf-list li:last-child {
    margin-bottom: 0;
}

.pdf-bottom-note {
    border-radius: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px dashed var(--pdf-line-deep);
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

@media (max-width: 820px) {
    .pdf-tool-grid,
    .pdf-info-grid,
    .pdf-trust-row {
        grid-template-columns: 1fr;
    }

    .pdf-workbench-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdf-current-pill {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .pdf-page {
        align-items: flex-start;
        padding: 16px 12px 24px;
    }

    .pdf-card {
        padding: 20px;
        border-radius: 20px;
    }

    .pdf-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdf-title {
        font-size: 26px;
    }

    .pdf-tool-card {
        padding: 18px;
    }

    .pdf-tool-desc {
        min-height: auto;
    }

    .pdf-section-title {
        font-size: 22px;
    }

    .pdf-file-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .pdf-file-actions,
    .pdf-result-actions {
        width: 100%;
    }

    .pdf-file-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .pdf-btn-primary,
    .pdf-btn-secondary {
        width: 100%;
    }

    .pdf-file-remove {
        width: 100%;
    }

    .pdf-file-list {
        max-height: 240px;
    }
}

/* ===== PDF 拆分工作台 ===== */
.pdf-split-shell {
    margin-top: 20px;
}

.pdf-split-form {
    display: grid;
    gap: 12px;
}

.pdf-field {
    display: grid;
    gap: 8px;
}

.pdf-field-label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.pdf-input {
    width: 100%;
    height: 48px;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    padding: 0 14px;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: all 0.2s ease;
}

.pdf-input:focus {
    border-color: var(--pdf-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.pdf-field-hint {
    font-size: 12px;
    color: var(--pdf-soft);
    line-height: 1.7;
}

.pdf-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pdf-single-file-wrap {
    display: grid;
    gap: 10px;
}

.pdf-single-file-empty {
    border-radius: 14px;
    border: 1px dashed #dbeafe;
    background: #ffffff;
    padding: 14px 16px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 640px) {
    .pdf-inline-actions {
        width: 100%;
    }

    .pdf-inline-actions .pdf-btn-ghost {
        flex: 1 1 100%;
    }
}

/* ===== PDF 转 PNG 工作台 ===== */
.pdf-png-shell {
    margin-top: 20px;
}

.pdf-select {
    width: 100%;
    height: 48px;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    padding: 0 14px;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: all 0.2s ease;
}

.pdf-select:focus {
    border-color: var(--pdf-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.pdf-png-result-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pdf-png-card {
    background: #fff;
    border: 1px solid #e6eefc;
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.pdf-png-preview-wrap {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5edf8;
}

.pdf-png-preview {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
}

.pdf-png-meta {
    display: grid;
    gap: 6px;
}

.pdf-png-name {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    word-break: break-all;
}

.pdf-png-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

@media (max-width: 820px) {
    .pdf-png-result-grid {
        grid-template-columns: 1fr;
    }
}
