/* O泡 批量处理面板 */

body.bt-lock { overflow: hidden; }

/* 页面内的批量入口 */
.bt-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto 16px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.42);
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.14), rgba(99, 102, 241, 0.12));
    color: #dbeafe;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.bt-entry:hover {
    border-color: rgba(103, 232, 249, 0.8);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.22);
    transform: translateY(-1px);
}

.bt-entry__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    font-size: 0.86rem;
}

.bt-entry__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.bt-entry__text b { font-size: 0.84rem; font-weight: 700; color: #e6f4ff; }
.bt-entry__text em { font-style: normal; font-size: 0.7rem; color: #8fa3bd; }
.bt-entry__arrow { flex: none; font-size: 0.72rem; color: #67e8f9; }

/* 弹窗内提示 */
.bt-tip {
    margin: 0 22px 8px;
    font-size: 0.7rem;
    line-height: 1.6;
    color: #6f7f96;
}

.bt-retry {
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    font-size: 0.72rem;
    cursor: pointer;
}

.bt-retry:hover { border-color: rgba(103, 232, 249, 0.75); color: #e0f7ff; }

.bt-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.05);
    color: #a8b6ca;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.bt-open span {
    font-weight: 500;
    font-size: 0.72rem;
    color: #728094;
}

.bt-open:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.08);
    color: #e2f4ff;
}

.bt-mask {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 8, 15, 0.72);
    backdrop-filter: blur(6px);
}

.bt-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 660px;
    max-height: min(86vh, 760px);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(160deg, #141b28, #0a0f18);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    color: #e2e8f2;
    overflow: hidden;
}

/* 内嵌在工具页中的面板 */
.bt-panel--inline {
    max-width: none;
    max-height: none;
    margin-bottom: 16px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(2, 8, 20, 0.28);
}

.bt-panel.is-hidden { display: none; }
.bt-panel--inline .bt-list { max-height: 320px; }

.bt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.bt-head h3 {
    margin: 0 0 5px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5fd;
}

.bt-head p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.6;
    color: #7f8da3;
}

.bt-close {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.06);
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.bt-close:hover { color: #f1f5f9; border-color: rgba(148, 163, 184, 0.4); }

.bt-collapse {
    flex: none;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.06);
    color: #93a4bc;
    font-size: 0.7rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bt-collapse:hover { color: #e2f4ff; border-color: rgba(103, 232, 249, 0.5); }
.bt-collapse:disabled { opacity: 0.4; cursor: not-allowed; }

.bt-head__ops { display: flex; align-items: center; gap: 8px; flex: none; }

.bt-add,
.bt-exit {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    cursor: pointer;
}

.bt-add {
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
}

.bt-add:hover { border-color: rgba(103, 232, 249, 0.8); color: #e0f7ff; }

.bt-exit {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: transparent;
    color: #93a4bc;
}

.bt-exit:hover { border-color: rgba(248, 113, 113, 0.5); color: #fca5a5; }
.bt-add:disabled,
.bt-exit:disabled { opacity: 0.4; cursor: not-allowed; }

.bt-fix {
    margin-left: 6px;
    color: #67e8f9;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.bt-fix:hover { color: #a5f3fc; text-decoration: underline; }

html[data-theme="light"] .bt-fix { color: #0369a1; }

/* 面板内确认框 */
.bt-dialog {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-radius: inherit;
    background: rgba(4, 8, 16, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.bt-dialog.is-open { display: flex; }

.bt-dialog__box {
    width: 100%;
    max-width: 360px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(129, 140, 248, 0.28);
    background: linear-gradient(160deg, #171f2e, #0a1018);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.bt-dialog__box h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #eaf2ff;
}

.bt-dialog__text {
    margin: 0 0 18px;
    font-size: 0.78rem;
    line-height: 1.75;
    color: #93a4bc;
}

.bt-dialog__ops {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bt-dialog__cancel,
.bt-dialog__ok {
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 0.78rem;
    cursor: pointer;
}

.bt-dialog__cancel {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.06);
    color: #cbd5e1;
}

.bt-dialog__cancel:hover { border-color: rgba(148, 163, 184, 0.45); color: #f1f5f9; }

.bt-dialog__ok {
    border: 1px solid transparent;
    background: linear-gradient(120deg, #ef4444, #f97316);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
}

.bt-dialog__ok:hover { filter: brightness(1.06); }

/* 轻提示 */
.bt-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: min(90vw, 460px);
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #e2e8f2;
    background: rgba(15, 23, 38, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bt-toast--warning { border-color: rgba(251, 191, 36, 0.45); }
.bt-toast--error { border-color: rgba(248, 113, 113, 0.5); }
.bt-toast--success { border-color: rgba(52, 211, 153, 0.45); }
.bt-toast.is-out { opacity: 0; transform: translateX(-50%) translateY(8px); }

.bt-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 16px 22px;
    padding: 22px 16px;
    border-radius: 14px;
    border: 1px dashed rgba(56, 189, 248, 0.34);
    background: rgba(56, 189, 248, 0.05);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

.bt-drop.is-over,
.bt-drop:hover {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.1);
}

.bt-drop i { font-size: 1.3rem; color: #67e8f9; }
.bt-drop b { font-size: 0.86rem; color: #dbeafe; font-weight: 600; }
.bt-drop span { font-size: 0.7rem; color: #74839a; }

.bt-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 6px;
}

.bt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(148, 163, 184, 0.04);
}

.bt-row.is-working { border-color: rgba(56, 189, 248, 0.4); }
.bt-row.is-done { border-color: rgba(52, 211, 153, 0.34); }
.bt-row.is-failed,
.bt-row.is-invalid { border-color: rgba(248, 113, 113, 0.35); }
.bt-row.is-skipped { opacity: 0.62; }

.bt-thumb {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 9px;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.8);
}

.bt-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.bt-info b {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    font-weight: 600;
    color: #dbe4f0;
}

.bt-info span {
    font-size: 0.7rem;
    color: #71809a;
}

.bt-state { color: #93a4bc; }
.bt-row.is-working .bt-state { color: #67e8f9; }
.bt-row.is-done .bt-state { color: #6ee7b7; }
.bt-row.is-failed .bt-state,
.bt-row.is-invalid .bt-state,
.bt-row.is-skipped .bt-state { color: #fca5a5; }

.bt-ops {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.bt-dl,
.bt-remove {
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.72rem;
    text-decoration: none;
    cursor: pointer;
}

.bt-dl {
    border: 1px solid rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
}

.bt-remove {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: transparent;
    color: #8695ab;
}

.bt-remove:hover { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }

.bt-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 22px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.bt-sum { font-size: 0.78rem; color: #8695ab; }
.bt-sum b { color: #f6c453; font-size: 0.94rem; }
.bt-sum em { color: #6ee7b7; font-style: normal; }

.bt-foot__ops { display: flex; gap: 10px; }

.bt-start,
.bt-zip {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.bt-start {
    background: linear-gradient(120deg, #4f46e5, #0ea5e9);
    color: #fff;
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.3);
}

.bt-zip {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.06);
    color: #c7d3e3;
}

.bt-start:disabled,
.bt-zip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* 浅色主题 */
html[data-theme="light"] .bt-panel {
    border-color: #e2e8f0;
    background: #fff;
    color: #1e293b;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
}

html[data-theme="light"] .bt-head { border-bottom-color: #eef2f7; }
html[data-theme="light"] .bt-head h3 { color: #0f172a; }
html[data-theme="light"] .bt-head p { color: #64748b; }
html[data-theme="light"] .bt-close { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
html[data-theme="light"] .bt-collapse { border-color: #e2e8f0; background: #f8fafc; color: #475569; }
html[data-theme="light"] .bt-add { border-color: #bae6fd; background: #eff6ff; color: #0369a1; }
html[data-theme="light"] .bt-exit { border-color: #e2e8f0; color: #64748b; }
html[data-theme="light"] .bt-dialog { background: rgba(241, 245, 249, 0.78); }
html[data-theme="light"] .bt-dialog__box { background: #fff; border-color: #e2e8f0; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18); }
html[data-theme="light"] .bt-dialog__box h4 { color: #0f172a; }
html[data-theme="light"] .bt-dialog__text { color: #64748b; }
html[data-theme="light"] .bt-dialog__cancel { border-color: #e2e8f0; background: #f8fafc; color: #475569; }
html[data-theme="light"] .bt-toast { background: #fff; color: #1e293b; border-color: #e2e8f0; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16); }
html[data-theme="light"] .bt-drop { border-color: #bae6fd; background: #f0f9ff; }
html[data-theme="light"] .bt-drop b { color: #0f172a; }
html[data-theme="light"] .bt-drop span { color: #64748b; }
html[data-theme="light"] .bt-row { border-color: #eef2f7; background: #f8fafc; }
html[data-theme="light"] .bt-row.is-working { border-color: #7dd3fc; background: #f0f9ff; }
html[data-theme="light"] .bt-row.is-done { border-color: #a7f3d0; background: #f0fdf9; }
html[data-theme="light"] .bt-row.is-failed,
html[data-theme="light"] .bt-row.is-invalid { border-color: #fecaca; background: #fef2f2; }
html[data-theme="light"] .bt-info b { color: #1e293b; }
html[data-theme="light"] .bt-info span { color: #64748b; }
html[data-theme="light"] .bt-foot { border-top-color: #eef2f7; }
html[data-theme="light"] .bt-sum { color: #64748b; }
html[data-theme="light"] .bt-sum b { color: #b45309; }
html[data-theme="light"] .bt-zip { border-color: #e2e8f0; background: #f8fafc; color: #334155; }
html[data-theme="light"] .bt-open { border-color: #e2e8f0; background: #f8fafc; color: #475569; }
html[data-theme="light"] .bt-open span { color: #94a3b8; }
html[data-theme="light"] .bt-open:hover { border-color: #7dd3fc; background: #f0f9ff; color: #0369a1; }
html[data-theme="light"] .bt-entry {
    border-color: #bae6fd;
    background: linear-gradient(120deg, #eff6ff, #eef2ff);
    color: #1e293b;
}
html[data-theme="light"] .bt-entry__text b { color: #0f172a; }
html[data-theme="light"] .bt-entry__text em { color: #64748b; }
html[data-theme="light"] .bt-entry__arrow { color: #0284c7; }
html[data-theme="light"] .bt-tip { color: #64748b; }

@media (max-width: 640px) {
    .bt-mask { padding: 12px; align-items: flex-end; }
    .bt-panel { max-height: 92vh; border-radius: 16px 16px 0 0; }
    .bt-head, .bt-list, .bt-foot { padding-left: 16px; padding-right: 16px; }
    .bt-drop { margin: 12px 16px; }
    .bt-foot { flex-direction: column; align-items: stretch; }
    .bt-foot__ops { display: grid; grid-template-columns: 1fr 1fr; }
    .bt-start, .bt-zip { width: 100%; }
}
