/* ==========================================================
   PNG 透明通道去除工具
   ========================================================== */

.iar .tool-title,
.iar .tool-subtitle { text-align: center; }

.iar-wrap {
    max-width: 880px;
    margin: 28px auto 60px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------------- 安全提示 ---------------- */
.iar-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f0f7ff;
    border: 1px solid #d8e8fb;
    color: #3a5a80;
    font-size: 13px;
    line-height: 1.7;
}

.iar-tip svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: #1760e8;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------------- 上传区 ---------------- */
.iar-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 44px 24px;
    border: 1.5px dashed #d3d9e2;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
    cursor: pointer;
    text-align: center;
    transition: border-color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.iar-drop:hover,
.iar-drop.is-drag {
    border-color: #1760e8;
    background: #f4f9ff;
}

.iar-drop.is-drag {
    transform: scale(1.005);
    box-shadow: 0 0 0 5px rgba(23, 96, 232, .1);
}

.iar-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.iar-drop-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8eaee;
    box-shadow: 0 3px 10px rgba(16, 24, 40, .07);
    color: #1760e8;
}

.iar-drop-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.iar-drop-title {
    font-size: 14.5px;
    font-weight: 600;
    color: #15181d;
}

.iar-drop-hint {
    font-size: 12px;
    color: #8b93a0;
}

/* ---------------- 卡片 ---------------- */
.iar-card {
    background: #fff;
    border: 1px solid #e8eaee;
    border-radius: 16px;
    padding: 22px 24px 24px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 10px 26px rgba(16, 24, 40, .04);
}

.iar-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: #15181d;
}

.iar-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.iar-count {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    margin-left: 6px;
    border-radius: 999px;
    background: #eef2f7;
    color: #5b6472;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
}

.iar-actions { display: flex; gap: 8px; }

/* ---------------- 处理方式 ---------------- */
.iar-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.iar-mode {
    display: block;
    cursor: pointer;
}

.iar-mode > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.iar-mode-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
    padding: 14px 16px;
    border: 1px solid #e8eaee;
    border-radius: 12px;
    background: #fbfcfd;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.iar-mode:hover .iar-mode-body {
    background: #fff;
    border-color: #d6dbe2;
}

.iar-mode > input:checked + .iar-mode-body {
    background: #f7faff;
    border-color: #1760e8;
    box-shadow: 0 0 0 3px rgba(23, 96, 232, .1);
}

.iar-mode-body strong {
    font-size: 13.5px;
    font-weight: 650;
    color: #15181d;
}

.iar-mode-body small {
    font-size: 11.5px;
    line-height: 1.7;
    color: #8b93a0;
}

.iar-mode-body input[type="color"] {
    margin-top: 8px;
    width: 46px;
    height: 26px;
    padding: 2px;
    border: 1px solid #e0e4ea;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.iar-hint {
    margin: 16px 0 0;
    font-size: 12px;
    color: #8b93a0;
}

.iar-hint code {
    padding: 1px 6px;
    border-radius: 5px;
    background: #f2f4f7;
    border: 1px solid #e8ebef;
    font-size: 11.5px;
    color: #475467;
}

/* ---------------- 结果列表 ---------------- */
.iar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.iar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    background: #fbfcfd;
}

.iar-thumb {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 8px;
    border: 1px solid #e8eaee;
    object-fit: contain;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #eef0f3 25%, transparent 25%),
        linear-gradient(-45deg, #eef0f3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef0f3 75%),
        linear-gradient(-45deg, transparent 75%, #eef0f3 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

.iar-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.iar-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #15181d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iar-sub {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    color: #8b93a0;
    line-height: 1.6;
}

.iar-sub .is-ok { color: #067647; font-weight: 600; }
.iar-sub .is-warn { color: #b54708; font-weight: 600; }
.iar-sub .is-bad { color: #b42318; font-weight: 600; }

.iar-item-actions {
    flex: none;
    display: flex;
    gap: 8px;
}

/* ---------------- 按钮 ---------------- */
.iar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #dce0e6;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease,
                transform .18s ease, box-shadow .18s ease;
}

.iar-btn:hover {
    background: #f4f7ff;
    border-color: #b9cdf5;
    color: #1760e8;
    transform: translateY(-1px);
}

.iar-btn:active { transform: translateY(0) scale(.98); }

.iar-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.iar-btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #1760e8;
    border-color: #1760e8;
    color: #fff;
}

.iar-btn-primary::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 100%;
    left: 100%;
    width: 160px;
    height: 120px;
    border-radius: 50%;
    background: #0f47b8;
    transition: top .6s ease, left .6s ease;
}

.iar-btn-primary:hover {
    background: #1760e8;
    border-color: #1760e8;
    color: #fff;
}

.iar-btn-primary:hover::before { top: -40px; left: -40px; }

.iar-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.85;
    color: #9aa1ab;
    text-align: center;
}

@media (max-width: 720px) {
    .iar-modes { grid-template-columns: 1fr; }
    .iar-card { padding: 18px 16px 20px; }
    .iar-item { flex-wrap: wrap; }
    .iar-item-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================
   页头：返回工具列表 / 收藏（与其它工具保持一致）
   ========================================================== */
.iar .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.iar .back-btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
    transition: background-color .3s ease, color .3s ease, transform .3s ease;
}

.iar .back-btn:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.iar .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iar .favorite-button {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color .3s ease, color .3s ease, transform .3s ease;
}

.iar .favorite-button:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.iar .favorite-button.favorited {
    background-color: #fff8e1;
    color: #f9a825;
}

.iar .favorite-button.favorited:hover {
    background-color: #ffecb3;
    color: #f57f17;
}

/* ---------------- 已选图片数量 ---------------- */
.iar-selected {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #95a5a6;
}

.iar-selected.has-files { color: #27ae60; }

.iar-selected b {
    margin: 0 3px;
    color: #e74c3c;
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .iar .back-btn,
    .iar .favorite-button {
        padding: 8px 12px;
        font-size: 13px;
    }
}
