.imgmp-page {
    padding: 0;
    min-height: 100%;
    background: #f6f7fb;
}

.imgmp-banner {
    background: #ffffff;
    border: 1px solid #dbe4f3;
    border-bottom: none;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    box-sizing: border-box;
}

.imgmp-banner__slogan {
    font-size: 28px;
    line-height: 1.4;
    font-weight: 700;
    color: #1e1e1e;
    letter-spacing: 1px;
    text-align: center;
}

.imgmp-block {
    background: #ffffff;
    border: 1px solid #dbe4f3;
    padding: 18px 20px;
    box-sizing: border-box;
}

.imgmp-block + .imgmp-block {
    border-top: none;
}

.imgmp-block__title {
    font-size: 18px;
    line-height: 1.5;
    color: #222;
    text-align: center;
    margin-bottom: 14px;
    font-weight: 700;
}

/* ===== 预览区 ===== */
.imgmp-block--preview {
    min-height: 560px;
    text-align: center;
    padding-top: 22px;
    padding-bottom: 24px;
}

.imgmp-preview-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 470px;
}

.imgmp-preview-sheet {
    background: #ffffff;
    border: 1px solid #dfe6d8;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-radius: 2px;
}

.imgmp-preview-sheet--portrait {
    width: 560px;
    height: 790px;
    max-height: calc(100vh - 280px);
}

.imgmp-preview-sheet--landscape {
    width: 790px;
    height: 560px;
    max-width: 100%;
}

.imgmp-preview-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

.imgmp-preview-header {
    position: absolute;
    top: 14px;
    left: 70px;
    right: 70px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
}

.imgmp-preview-safe {
    position: absolute;
    overflow: hidden;
    box-sizing: border-box;
}

.imgmp-preview-guides {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.imgmp-preview-guide {
    position: absolute;
    background: transparent;
}

.imgmp-preview-guide--v {
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px dashed #8d8d8d;
}

.imgmp-preview-guide--h {
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed #8d8d8d;
}

.imgmp-preview-grid {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 10px;
    align-items: center;
    justify-items: center;
    z-index: 2;
}

.imgmp-preview-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
    box-sizing: border-box;
}

.imgmp-preview-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    box-sizing: border-box;
    border-radius: 2px;
}

.imgmp-preview-card img.is-bordered {
    border: 1px solid rgba(0, 0, 0, 0.32);
}

.imgmp-preview-page-number {
    position: absolute;
    bottom: 12px;
    min-height: 20px;
    font-size: 14px;
    line-height: 1.2;
    color: #333333;
    z-index: 3;
    pointer-events: none;
}

.imgmp-preview-page-number--hidden {
    display: none;
}

.imgmp-preview-page-number--left {
    left: 18px;
    text-align: left;
}

.imgmp-preview-page-number--center {
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.imgmp-preview-page-number--right {
    right: 18px;
    text-align: right;
}

/* ===== 设置区 ===== */
.imgmp-block--settings {
    overflow-x: auto;
    padding-top: 16px;
    padding-bottom: 16px;
}

.imgmp-settings-row {
    display: grid;
    gap: 10px 12px;
    align-items: center;
}

.imgmp-settings-row + .imgmp-settings-row {
    margin-top: 10px;
}

.imgmp-settings-row--top {
    grid-template-columns: 1fr 1fr 1.7fr 0.82fr 0.82fr 0.82fr 0.82fr;
}

.imgmp-settings-row--bottom {
    grid-template-columns: 1.1fr 1.6fr 3fr;
}

.imgmp-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.imgmp-item__label {
    flex-shrink: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
}

.imgmp-item__control {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid #cfe0c9;
    background: #dff0d7;
    padding: 0 10px;
    font-size: 14px;
    color: #1f1f1f;
    outline: none;
    box-sizing: border-box;
    border-radius: 2px;
}

.imgmp-item__control:focus {
    border-color: #8fc16d;
    box-shadow: 0 0 0 2px rgba(143, 193, 109, 0.12);
}

.imgmp-item__compound {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.imgmp-item__compound .imgmp-item__control {
    flex: 1;
}

.imgmp-item__compound em {
    flex-shrink: 0;
    font-style: normal;
    color: #444;
    font-size: 14px;
}

.imgmp-item__checkwrap {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.imgmp-item__checkwrap span {
    color: #444;
    font-size: 14px;
    line-height: 1.5;
}

.imgmp-margins {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.imgmp-margins__title {
    flex-shrink: 0;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

/* ===== 文件区 ===== */
.imgmp-block--files {
    padding-top: 18px;
    padding-bottom: 22px;
}

.imgmp-error {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fff4f4;
    border: 1px solid #f1c8c8;
    color: #c52828;
    font-size: 15px;
    line-height: 1.7;
    border-radius: 4px;
}

.imgmp-files-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.imgmp-files-head__summary {
    font-size: 16px;
    line-height: 1.8;
    color: #202020;
}

.imgmp-files-head__summary strong {
    color: #1a1a1a;
}

.imgmp-files-head__action {
    flex-shrink: 0;
}

.imgmp-files-head__action .tool-btn {
    min-width: 210px;
    height: 62px;
    font-size: 20px;
    border-radius: 14px;
}

.imgmp-files-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 18px;
    align-items: start;
}

.imgmp-table-wrap {
    min-width: 0;
    border: 1px solid #ebeff5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.imgmp-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.imgmp-table th,
.imgmp-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf1f6;
    font-size: 15px;
    color: #1f1f1f;
    text-align: center;
    vertical-align: middle;
}

.imgmp-table thead th {
    background: #f7f9fc;
    font-size: 15px;
    font-weight: 700;
    color: #28323f;
}

.imgmp-table__name {
    text-align: left !important;
    word-break: break-all;
}

.imgmp-table tbody tr:hover {
    background: #fafcff;
}

.imgmp-table__empty {
    text-align: center !important;
    color: #888;
    padding: 24px 0 !important;
}

.imgmp-ops {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.imgmp-ops__btn {
    height: 42px;
    border: none;
    border-radius: 18px;
    background: #b9dcbc;
    color: #17311a;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.imgmp-ops__btn:hover {
    background: #abd3af;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.imgmp-ops__btn:active {
    transform: translateY(0);
}

.imgmp-invalid-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #fdeaea;
    color: #bb2d2d;
    font-size: 12px;
    line-height: 20px;
    vertical-align: middle;
}

.imgmp-invalid-text,
.imgmp-invalid-reason {
    margin-top: 4px;
    font-size: 12px;
    color: #bb2d2d;
    line-height: 1.5;
}

.imgmp-invalid-radio {
    font-size: 12px;
    color: #999;
}

/* ===== 弹窗 ===== */
.imgmp-modal {
    width: 980px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.imgmp-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.imgmp-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #1f1f1f;
}

.imgmp-modal__body {
    background: #fafbf8;
    border: 1px solid #e4e9de;
    border-radius: 8px;
    overflow: hidden;
}

.imgmp-modal__frame {
    width: 100%;
    height: 620px;
    border: 0;
    display: block;
    background: #fff;
}

.imgmp-modal__foot {
    margin-top: 10px;
    text-align: right;
}

/* ===== 结果页 ===== */
.imgmp-result-preview-panel {
    margin-top: 20px;
}

.imgmp-result-preview-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.imgmp-result-preview-frame-wrap {
    width: 100%;
    min-height: 820px;
    border: 1px solid #dbe4ea;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fbfd;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.imgmp-result-preview-frame {
    width: 100%;
    height: 820px;
    border: 0;
    display: block;
    background: #fff;
}

/* ===== 响应式 ===== */
@media (max-width: 1500px) {
    .imgmp-preview-sheet--portrait {
        width: 500px;
        height: 705px;
    }

    .imgmp-preview-sheet--landscape {
        width: 700px;
        height: 500px;
    }

    .imgmp-settings-row--top {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .imgmp-settings-row--bottom {
        grid-template-columns: 1fr 1fr;
    }

    .imgmp-margins {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 1200px) {
    .imgmp-files-body {
        grid-template-columns: 1fr;
    }

    .imgmp-ops {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .imgmp-ops__btn {
        min-width: 120px;
    }
}

@media (max-width: 1100px) {
    .imgmp-preview-sheet--portrait,
    .imgmp-preview-sheet--landscape {
        width: 100%;
        max-width: 700px;
        height: auto;
        aspect-ratio: 1 / 1.414;
    }

    .imgmp-settings-row--top,
    .imgmp-settings-row--bottom {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .imgmp-margins {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .imgmp-files-head {
        flex-direction: column;
        align-items: stretch;
    }

    .imgmp-files-head__action .tool-btn {
        width: 100%;
    }

    .imgmp-settings-row--top,
    .imgmp-settings-row--bottom {
        grid-template-columns: 1fr;
    }

    .imgmp-item,
    .imgmp-margins {
        flex-wrap: wrap;
    }

    .imgmp-table th,
    .imgmp-table td {
        font-size: 13px;
        padding: 6px 6px;
    }

    .imgmp-result-preview-frame-wrap {
        min-height: 560px;
    }

    .imgmp-result-preview-frame {
        height: 560px;
    }

    .imgmp-modal {
        padding: 14px;
    }

    .imgmp-modal__frame {
        height: 480px;
    }
}