/* remjs 新工具页 — 覆盖 pc.css 中 float 布局，避免错位 */

.remjs-tools-page {
    width: 100%;
    box-sizing: border-box;
}

.remjs-tools-page .qtool-wrap,
.remjs-tools-page .qtool-card,
.remjs-tools-page .qtool-card.vmxform,
.remjs-tools-page .qtool-form,
.remjs-tools-page .qtool-actions {
    float: none !important;
    clear: both;
    width: 100%;
    box-sizing: border-box;
}

.remjs-tools-page .qtool-row,
.remjs-tools-page .vmxinputpanel {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    margin-bottom: 16px;
    min-width: 0;
}

.remjs-tools-page .qtool-label {
    display: block;
    margin-bottom: 8px;
}

.remjs-tools-page .qtool-textarea,
.remjs-tools-page .qtool-input,
.remjs-tools-page .qtool-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.remjs-tools-page .qtool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 4px;
    padding-top: 4px;
}

.remjs-tools-page .qtool-actions .qtool-btn {
    float: none !important;
    margin: 0;
}

.remjs-tools-page .rt-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    float: none !important;
}

.remjs-tools-page .rt-grid-2 > .qtool-card,
.remjs-tools-page .rt-grid-2 > .qtool-row {
    margin-bottom: 0;
    min-width: 0;
}

.remjs-tools-page .rt-preview {
    min-height: 120px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
}

.remjs-tools-page .rt-preview--dark {
    background: #1e1e1e;
    color: #d4d4d4;
}

.remjs-tools-page .rt-code {
    margin: 0;
    padding: 14px;
    border-radius: 10px;
    background: #f3f4f6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.remjs-tools-page .rt-diff {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.remjs-tools-page .rt-diff-add {
    background: #ecfdf5;
    color: #065f46;
}

.remjs-tools-page .rt-diff-del {
    background: #fef2f2;
    color: #991b1b;
}

.remjs-tools-page .rt-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    width: 100%;
}

.remjs-tools-page .rt-check-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    cursor: pointer;
    font-weight: 500;
    float: none !important;
}

.remjs-tools-page .rt-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.remjs-tools-page .rt-stat {
    padding: 14px;
    border-radius: 12px;
    background: #f0fdf4;
    border: 1px solid rgba(90, 172, 44, 0.2);
}

.remjs-tools-page .rt-stat__label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.remjs-tools-page .rt-stat__value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    word-break: break-all;
}

.remjs-tools-page .rt-url-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.remjs-tools-page .rt-url-table th,
.remjs-tools-page .rt-url-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.remjs-tools-page .rt-url-table th {
    width: 120px;
    color: #6b7280;
    font-weight: 600;
}

.remjs-tools-page .rt-url-table code {
    word-break: break-all;
}

.remjs-tools-page .rt-mermaid-wrap,
.remjs-tools-page .rt-wechat-preview {
    min-height: 240px;
    overflow: auto;
}

.remjs-tools-page .rt-wechat-preview {
    max-width: 578px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    line-height: 1.8;
    color: #3f3f3f;
}

.remjs-tools-page .rt-wechat-preview h1,
.remjs-tools-page .rt-wechat-preview h2,
.remjs-tools-page .rt-wechat-preview h3 {
    font-weight: bold;
    margin: 1em 0 0.5em;
}

.remjs-tools-page .rt-wechat-preview blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 4px solid #07c160;
    background: #f7f7f7;
    color: #666;
}

.remjs-tools-page .rt-wechat-preview pre {
    margin: 12px 0;
    padding: 12px;
    background: #282c34;
    color: #abb2bf;
    border-radius: 6px;
    overflow: auto;
    font-size: 14px;
}

.remjs-tools-page .rt-wechat-preview code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 90%;
}

.remjs-tools-page .rt-wechat-preview img {
    max-width: 100%;
    display: block;
    margin: 12px auto;
}

.remjs-tools-page .rt-cron-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.remjs-tools-page .rt-scroll-capture {
    max-height: 480px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.remjs-tools-page .rt-scroll-capture iframe,
.remjs-tools-page .rt-scroll-capture .rt-html-render {
    width: 100%;
    min-height: 400px;
    border: 0;
}

.remjs-tools-page .resultdata {
    width: 100%;
    float: none !important;
    clear: both;
    margin-top: 16px;
}

.remjs-tools-page .qtool-result-block {
    width: 100%;
    box-sizing: border-box;
}

.remjs-tools-page .qtool-result__box,
.remjs-tools-page .vmxresult {
    width: 100%;
    box-sizing: border-box;
    float: none !important;
}

.remjs-tools-page .qtool-result__textarea {
    width: 100%;
    min-height: 200px;
    box-sizing: border-box;
}

.remjs-tools-page .qtool-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.remjs-tools-page .qtool-radio__item {
    float: none !important;
}

@media (max-width: 768px) {
    .remjs-tools-page .rt-grid-2 {
        grid-template-columns: 1fr;
    }

    .remjs-tools-page .rt-cron-row {
        grid-template-columns: 1fr;
    }

    .remjs-tools-page .qtool-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .remjs-tools-page .qtool-actions .qtool-btn {
        width: 100%;
    }
}

/* PDF 在线编辑器 */
.pdfed-page .pdfed-upload__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    padding: 32px 24px;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    text-align: center;
}

.pdfed-page .pdfed-upload__zone:hover {
    border-color: #478a21;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
    box-shadow: 0 8px 24px rgba(71, 138, 33, .08);
}

.pdfed-page .pdfed-upload__zone i {
    font-size: 42px;
    color: #478a21;
    line-height: 1;
}

.pdfed-page .pdfed-upload__zone span {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.pdfed-page .pdfed-upload__zone small {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.pdfed-page .pdfed-work {
    display: none;
}

.pdfed-page .pdfed-work.is-active {
    display: block;
}

.pdfed-page .pdfed-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.pdfed-page .pdfed-sidebar {
    position: sticky;
    top: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fafafa;
}

.pdfed-page .pdfed-sidebar__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 10px;
}

.pdfed-page .pdfed-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdfed-page .pdfed-tool {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
}

.pdfed-page .pdfed-tool i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #6b7280;
}

.pdfed-page .pdfed-tool:hover {
    border-color: #d1d5db;
    background: #fff;
}

.pdfed-page .pdfed-tool.is-active {
    border-color: #478a21;
    background: #f0fdf4;
    color: #166534;
    box-shadow: 0 2px 8px rgba(71, 138, 33, .12);
}

.pdfed-page .pdfed-tool.is-active i {
    color: #478a21;
}

.pdfed-page .pdfed-tool--danger.is-active {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.pdfed-page .pdfed-tool--danger.is-active i {
    color: #dc2626;
}

.pdfed-page .pdfed-props {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.pdfed-page .pdfed-props .qtool-label {
    font-size: 13px;
    color: #4b5563;
}

.pdfed-page .pdfed-props .qtool-input {
    margin-bottom: 10px;
}

.pdfed-page .pdfed-image-preview {
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    text-align: center;
}

.pdfed-page .pdfed-image-preview img {
    max-width: 100%;
    max-height: 80px;
    border-radius: 4px;
}

.pdfed-page .pdfed-image-preview:empty {
    display: none;
}

.pdfed-page .pdfed-export {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.pdfed-page .pdfed-export .qtool-btn {
    width: 100%;
    justify-content: center;
}

.pdfed-page .pdfed-main {
    min-width: 0;
}

.pdfed-page .pdfed-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.pdfed-page .pdfed-filename {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdfed-page .pdfed-filename i {
    color: #dc2626;
    margin-right: 6px;
}

.pdfed-page .pdfed-pager {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border-radius: 999px;
    background: #f3f4f6;
}

.pdfed-page .pdfed-pager__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: background .15s;
}

.pdfed-page .pdfed-pager__btn:hover:not(:disabled) {
    background: #e5e7eb;
}

.pdfed-page .pdfed-pager__btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.pdfed-page .pdfed-pager__label {
    min-width: 72px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.pdfed-page .pdfed-change {
    font-size: 13px;
    color: #478a21;
    cursor: pointer;
    white-space: nowrap;
}

.pdfed-page .pdfed-change:hover {
    text-decoration: underline;
}

.pdfed-page .pdfed-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid rgba(59, 130, 246, .2);
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.pdfed-page .pdfed-hint i {
    flex-shrink: 0;
    font-size: 15px;
}

.pdfed-page .pdfed-viewport {
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background:
        linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
        linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
        linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #e5e7eb;
    overflow: auto;
    max-height: min(72vh, 820px);
    text-align: center;
}

.pdfed-page .pdfed-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
    user-select: none;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .18);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.pdfed-page .pdfed-stage img.page {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdfed-page .pdfed-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.pdfed-page .pdfed-overlay.is-erase {
    cursor: not-allowed;
}

.pdfed-page .pdfed-item {
    position: absolute;
    box-sizing: border-box;
    transition: box-shadow .12s;
}

.pdfed-page .pdfed-item--text {
    padding: 3px 6px;
    color: #111;
    background: rgba(255, 255, 255, .92);
    border: 1px dashed #478a21;
    border-radius: 4px;
    cursor: move;
    white-space: pre-wrap;
    max-width: 90%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.pdfed-page .pdfed-item--highlight {
    background: rgba(255, 235, 59, .42);
    border: 1px solid rgba(245, 158, 11, .55);
    border-radius: 2px;
}

.pdfed-page .pdfed-item--rect {
    border: 2px solid #478a21;
    border-radius: 4px;
    background: rgba(71, 138, 33, .04);
}

.pdfed-page .pdfed-item--image {
    border: 1px dashed #94a3b8;
    border-radius: 4px;
    background: rgba(255, 255, 255, .5);
    cursor: move;
}

.pdfed-page .pdfed-item--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.pdfed-page .pdfed-overlay.is-erase .pdfed-item {
    cursor: pointer;
}

.pdfed-page .pdfed-overlay.is-erase .pdfed-item:hover {
    outline: 2px solid #ef4444;
    outline-offset: 1px;
}

.pdfed-page .pdfed-draw-preview {
    position: absolute;
    pointer-events: none;
    border-radius: 2px;
    z-index: 10;
}

.pdfed-page .pdfed-draw-preview--highlight {
    background: rgba(255, 235, 59, .35);
    border: 1px solid rgba(245, 158, 11, .7);
}

.pdfed-page .pdfed-draw-preview--rect {
    border: 2px dashed #478a21;
    background: rgba(71, 138, 33, .06);
}

.pdfed-page .pdfed-item--redact {
    background: rgba(17, 17, 17, .88);
    border: 1px solid #000;
    border-radius: 2px;
    cursor: pointer;
}

.pdfed-page .pdfed-draw-preview--redact {
    background: rgba(17, 17, 17, .55);
    border: 1px dashed #111;
}

/* PDF 视觉对比 */
.pdfvisdiff-result {
    width: 100%;
}

.pdfvisdiff-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.pdfvisdiff-stat {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.pdfvisdiff-stat--warn {
    background: #fff7ed;
    border-color: rgba(249, 115, 22, .25);
}

.pdfvisdiff-stat__label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.pdfvisdiff-stat strong {
    font-size: 18px;
    color: #111827;
}

.pdfvisdiff-note {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.pdfvisdiff-page {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.pdfvisdiff-page__head {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.pdfvisdiff-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
}

.pdfvisdiff-badge--diff {
    background: #fef2f2;
    color: #b91c1c;
}

.pdfvisdiff-badge--ok {
    background: #f0fdf4;
    color: #166534;
}

.pdfvisdiff-triple {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pdfvisdiff-triple figure {
    margin: 0;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.pdfvisdiff-triple figcaption {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
    text-align: center;
}

.pdfvisdiff-triple img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
}

@media (max-width: 768px) {
    .pdfvisdiff-triple {
        grid-template-columns: 1fr;
    }
}

/* 扫描/拍照转 PDF */
.pdfscan-page .pdfscan-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.pdfscan-page .pdfscan-upload {
    flex: 1;
    min-width: 220px;
    min-height: 160px;
    margin: 0;
}

.pdfscan-page .pdfscan-camera {
    align-self: center;
    min-width: auto;
    padding: 14px 20px;
    font-size: 15px;
}

.pdfscan-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.pdfscan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fafafa;
}

.pdfscan-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.pdfscan-item__name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdfscan-item__acts {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.pdfscan-item__acts button {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pdfscan-item__acts button:hover {
    border-color: #478a21;
    color: #478a21;
}

.pdfscan-item__acts .pdfscan-del:hover {
    border-color: #ef4444;
    color: #ef4444;
}

@media (max-width: 900px) {
    .pdfed-page .pdfed-layout {
        grid-template-columns: 1fr;
    }

    .pdfed-page .pdfed-sidebar {
        position: static;
    }

    .pdfed-page .pdfed-tools {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .pdfed-page .pdfed-tool {
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
        justify-content: center;
    }

    .pdfed-page .pdfed-tool span {
        display: none;
    }

    .pdfed-page .pdfed-viewport {
        max-height: 56vh;
    }
}

/* 图片 Canvas 编辑器（圆形裁剪 / 加文字） */
.imged-page .imged-upload__zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    padding: 32px 24px;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    text-align: center;
}

.imged-page .imged-upload__zone:hover {
    border-color: #478a21;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
    box-shadow: 0 8px 24px rgba(71, 138, 33, .08);
}

.imged-page .imged-upload__zone i {
    font-size: 42px;
    color: #478a21;
    line-height: 1;
}

.imged-page .imged-upload__zone span {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.imged-page .imged-upload__zone small {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.imged-page .imged-work {
    display: none;
}

.imged-page .imged-work.is-active {
    display: block;
}

.imged-page .imged-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.imged-page .imged-sidebar {
    position: sticky;
    top: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fafafa;
}

.imged-page .imged-sidebar__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 10px;
}

.imged-page .imged-props .qtool-label {
    margin-top: 8px;
}

.imged-page .imged-props .qtool-select,
.imged-page .imged-props .qtool-input {
    width: 100%;
}

.imged-page .imged-range {
    width: 100%;
    margin: 4px 0 8px;
}

.imged-page .imged-color {
    width: 100%;
    height: 40px;
    padding: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.imged-page .imged-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* 侧边栏 / 顶栏按钮 */
.imged-page .imged-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 11px 18px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.imged-page .imged-btn i {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.imged-page .imged-btn--primary {
    background: linear-gradient(135deg, #5aac2c 0%, #478a21 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(71, 138, 33, .28);
}

.imged-page .imged-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(71, 138, 33, .34);
    color: #fff;
    text-decoration: none;
}

.imged-page .imged-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(71, 138, 33, .24);
}

.imged-page .imged-btn--ghost {
    background: #fff;
    color: #374151;
    border: 1.5px solid #d1d5db;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.imged-page .imged-btn--ghost:hover {
    border-color: rgba(90, 172, 44, .45);
    color: #166534;
    background: #f9fafb;
    text-decoration: none;
}

.imged-page .imged-btn--danger {
    background: #fff;
    color: #b91c1c;
    border: 1.5px solid #fecaca;
    box-shadow: 0 2px 8px rgba(185, 28, 28, .06);
}

.imged-page .imged-btn--danger:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}

.imged-page .imged-btn--sm {
    width: auto;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.imged-page .imged-btn--sm i {
    font-size: 14px;
}

.imged-page .imged-btn--export {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    box-shadow: 0 8px 22px rgba(71, 138, 33, .32);
}

.imged-page .imged-actions,
.imged-page .imged-export {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.imged-page .imged-export {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.imged-page .imged-main {
    min-width: 0;
}

.imged-page .imged-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.imged-page .imged-filename {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.imged-page .imged-filename span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.imged-page .imged-filename i {
    color: #478a21;
    flex-shrink: 0;
}

.imged-page .imged-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 13px;
    color: #166534;
    line-height: 1.5;
}

.imged-page .imged-hint i {
    margin-top: 2px;
    flex-shrink: 0;
}

.imged-page .imged-viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: auto;
}

.imged-page .imgcircle-viewport {
    background: #111827;
}

.imged-page .imgcircle-canvas,
.imged-page .imgaddtext-canvas {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    cursor: grab;
    touch-action: none;
}

.imged-page .imgcircle-canvas:active,
.imged-page .imgaddtext-canvas:active {
    cursor: grabbing;
}

.imged-page .imged-mode-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.imged-page .imged-mode-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.imged-page .imged-mode-tab:hover {
    border-color: rgba(90, 172, 44, .35);
}

.imged-page .imged-mode-tab.is-active {
    border-color: #478a21;
    background: #f0fdf4;
    color: #166534;
}

.imged-page .imged-mode-tip {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.imged-page .imgperspective-viewport {
    background: #111827;
}

.imged-page .imgperspective-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.imged-page .imgperspective-canvas {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.imged-page .imgperspective-overlay {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.imged-page .imgperspective-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #478a21;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    pointer-events: auto;
    cursor: grab;
    z-index: 2;
}

.imged-page .imgperspective-handle:active {
    cursor: grabbing;
}

.imged-page .imgperspective-lines {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 1;
}

.imged-page .idphoto-canvas,
.imged-page .imgphotoedit-canvas {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

@media (max-width: 900px) {
    .imged-page .imged-layout {
        grid-template-columns: 1fr;
    }

    .imged-page .imged-sidebar {
        position: static;
    }

    .imged-page .imged-viewport {
        max-height: 56vh;
    }

    .imged-page .imged-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .imged-page .imged-actions .imged-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 140px;
    }

    .imged-page .imged-export .imged-btn {
        width: 100%;
    }
}

.qtool-diff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.qtool-diff-table th,
.qtool-diff-table td {
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    vertical-align: top;
}

.qtool-diff-table th {
    background: #f9fafb;
}

.qtool-diff-table td.is-diff {
    background: #fff7ed;
}

.qtool-diff-table .diff-a {
    color: #111827;
    margin-bottom: 4px;
}

.qtool-diff-table .diff-b {
    color: #b45309;
    font-size: 12px;
}

.qtool-result-table-wrap {
    overflow: auto;
    max-height: 480px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.qtool-word-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.qtool-word-compare-table th,
.qtool-word-compare-table td {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    vertical-align: top;
    word-break: break-word;
}

.qtool-word-compare-table th {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 1;
}

.qtool-word-compare-table td.ln {
    width: 48px;
    text-align: right;
    color: #9ca3af;
    background: #fafafa;
}

.qtool-word-compare-table tr.is-diff td {
    background: #fff7ed;
}

.qtool-docx-preview {
    max-height: 560px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.qtool-docx-preview .docx-wrapper {
    margin: 0 auto;
}

.qtool-xlsx-preview {
    overflow: auto;
    max-height: 560px;
}

.qtool-xlsx-preview__title {
    margin: 16px 0 8px;
    font-size: 15px;
    color: #111827;
}

.qtool-xlsx-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

.qtool-xlsx-preview th,
.qtool-xlsx-preview td {
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
}

.qtool-xlsx-preview th {
    background: #f3f4f6;
}

.qtool-ppt-preview .slide {
    background: #1f2937;
    color: #f9fafb;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 12px 0;
    min-height: 100px;
}

.qtool-ppt-preview .slide h2 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #9ca3af;
}
