/* ============================
   backup.css - 数据备份 / 恢复页
   基于 train.css 的黑白极简风格补充
   ============================ */

/* 顶部提示条 */
.bk-note {
    border: 1.5px dashed var(--border, #e5e5e5);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.78rem;
    line-height: 1.85;
    color: var(--muted, #8a8a8a);
    margin-bottom: 14px;
}
.bk-note b { color: var(--fg, #1a1a1a); }

/* 数据清单 */
.bk-list { margin-top: 4px; }
.bk-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border, #eee);
    font-size: 0.8rem;
}
.bk-item:last-child { border-bottom: none; }
.bk-item-name { flex: 1; min-width: 0; word-break: break-word; }
.bk-item-meta { flex-shrink: 0; color: var(--muted, #8a8a8a); font-size: 0.7rem; text-align: right; }
.bk-item.is-empty .bk-item-name { color: var(--muted, #8a8a8a); }

.bk-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1.5px solid var(--fg, #1a1a1a);
    font-size: 0.82rem;
    font-weight: bold;
}

/* 按钮行 */
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bk-actions .tr-btn { flex: 1 1 auto; min-width: 120px; }

/* 选择文件区 */
.bk-drop {
    display: block;
    border: 1.5px dashed var(--fg, #1a1a1a);
    border-radius: 8px;
    padding: 18px 14px;
    text-align: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 10px;
}
.bk-drop:hover, .bk-drop:active { background: #f7f7f7; }
.bk-drop b { display: block; font-size: 0.9rem; margin-bottom: 3px; }
.bk-drop span { font-size: 0.7rem; color: var(--muted, #8a8a8a); }
.bk-drop input[type="file"] { display: none; }

/* 备份预览 */
.bk-preview {
    border: 1.5px solid var(--fg, #1a1a1a);
    border-radius: 8px;
    padding: 12px 13px;
    margin: 10px 0;
    font-size: 0.78rem;
    line-height: 1.8;
}
.bk-preview-head { font-weight: bold; margin-bottom: 6px; }
.bk-preview ul { margin: 6px 0 0; padding-left: 17px; }
.bk-preview li { margin-bottom: 3px; }
.bk-preview .bk-ok { color: #1d7a3e; }
.bk-preview .bk-new { color: var(--muted, #8a8a8a); }

/* 状态提示 */
.bk-status {
    margin-top: 10px;
    padding: 10px 13px;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.8;
    display: none;
}
.bk-status.show { display: block; }
.bk-status.ok { background: #f0f8f2; border: 1px solid #1d7a3e; color: #16602f; }
.bk-status.bad { background: #fdf3f2; border: 1px solid #c0392b; color: #a5311f; }

/* 撤回条 */
.bk-rollback {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--fg, #1a1a1a);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    margin-top: 10px;
}
.bk-rollback .bk-rb-text { flex: 1; min-width: 0; line-height: 1.6; }
.bk-rollback .bk-rb-text b { display: block; font-size: 0.82rem; }

/* 危险区 */
.bk-danger {
    border: 1.5px solid #c0392b;
    border-radius: 8px;
    padding: 14px;
    margin-top: 6px;
}
.bk-danger .bk-danger-title { color: #c0392b; font-weight: bold; font-size: 0.9rem; margin-bottom: 6px; }
.bk-danger p { font-size: 0.76rem; line-height: 1.8; color: var(--muted, #8a8a8a); margin: 0 0 10px; }

/* 导入时的粘贴框 */
.bk-paste { display: none; margin-top: 10px; }
.bk-paste.show { display: block; }

/* 查看备份内容弹窗 */
.bk-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.bk-mask.open { display: flex; }
.bk-box {
    background: var(--bg, #fff);
    color: var(--fg, #1a1a1a);
    border: 2px solid var(--fg, #1a1a1a);
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    padding: 14px 14px 12px;
    animation: bkPop 0.18s ease-out;
}
@keyframes bkPop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bk-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: bold;
    gap: 10px;
}
.bk-box-close {
    background: none;
    border: none;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 2px 6px;
    color: var(--fg, #1a1a1a);
}
.bk-box-tip { font-size: 0.7rem; color: var(--muted, #8a8a8a); margin: 4px 0 8px; }
.bk-box-text {
    flex: 1;
    min-height: 180px;
    width: 100%;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    padding: 9px 10px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.68rem;
    line-height: 1.6;
    resize: none;
    color: var(--fg, #1a1a1a);
    background: #fafafa;
    box-sizing: border-box;
}
.bk-box-actions { display: flex; gap: 8px; margin-top: 10px; }
.bk-box-actions .tr-btn { flex: 1; }
