* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #222;
}
a { color: #1890ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0f0f0; padding: 1px 6px; border-radius: 3px; font-family: "Menlo", monospace; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #1890ff; color: #fff; padding: 10px 24px;
}
.topbar .brand a { color: #fff; font-weight: bold; font-size: 18px; }
.topbar nav a { color: #fff; margin-left: 18px; opacity: .88; }
.topbar nav a:hover { opacity: 1; text-decoration: none; }

.content { padding: 18px 24px; }

.flash { padding: 10px 14px; margin-bottom: 12px; border-radius: 4px; }
.flash.error { background: #fff1f0; color: #a8071a; border: 1px solid #ffa39e; }
.flash.success { background: #f6ffed; color: #135200; border: 1px solid #b7eb8f; }

.btn {
  display: inline-block; padding: 6px 14px; border: 1px solid #d9d9d9;
  background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: #1890ff; color: #1890ff; }
.btn.primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn.primary:hover { background: #40a9ff; color: #fff; }
.btn.big { padding: 10px 20px; font-size: 15px; }
.btn.danger { border-color: #ff4d4f; color: #ff4d4f; }

.form label { display: block; margin-bottom: 12px; }
.form label input, .form label select { display: block; width: 100%; padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; margin-top: 4px; }
.form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: #fff; padding: 16px; border: 1px solid #e8e8e8; border-radius: 6px; margin-bottom: 16px; }
.form.inline label { flex: 1 1 160px; margin-bottom: 0; }

.auth-card {
  max-width: 420px; margin: 60px auto; background: #fff; padding: 30px;
  border: 1px solid #e8e8e8; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.auth-card h2 { margin-top: 0; }
.auth-card .hint { font-size: 13px; color: #666; }
.totp-qr { text-align: center; margin: 18px 0; }
.totp-qr img { max-width: 220px; height: auto; }

.dashboard-strip { display: flex; gap: 12px; margin-bottom: 18px; }
.metric { flex: 1; background: #fff; padding: 14px 18px; border: 1px solid #e8e8e8; border-radius: 6px; }
.mlabel { font-size: 12px; color: #888; }
.mval { font-size: 20px; font-weight: bold; margin-top: 4px; }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.panes.three { grid-template-columns: 1fr 200px 1fr; gap: 14px; }

.direction-col {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  padding: 16px 10px; background: #fff; border: 1px solid #e8e8e8;
  border-radius: 6px; min-height: 520px;
}
.dir-hint { font-size: 12px; color: #999; text-align: center; margin-bottom: 4px; }
.arrow-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fafafa; border: 2px solid #d9d9d9; border-radius: 8px;
  padding: 14px 8px; font-size: 13px; cursor: pointer; transition: all .12s;
  user-select: none;
}
.arrow-btn:hover { border-color: #1890ff; color: #1890ff; }
.arrow-btn .arr { font-size: 26px; line-height: 1; font-weight: bold; }
.arrow-btn .lbl { font-size: 12px; line-height: 1.3; }
.arrow-btn.selected { border-color: #1890ff; background: #e6f4ff; color: #1890ff; box-shadow: 0 0 0 3px rgba(24,144,255,0.15); }

.dir-summary {
  font-size: 12px; background: #fafafa; border: 1px solid #eee; border-radius: 4px;
  padding: 8px; margin-top: 4px;
}
.ds-line { display: flex; gap: 6px; padding: 2px 0; line-height: 1.4; word-break: break-all; }
.ds-line .label { color: #999; flex: 0 0 30px; }
#dsSrc, #dsDst { font-family: Menlo, monospace; font-size: 11px; color: #333; flex: 1; }

#btnStart:disabled { opacity: .45; cursor: not-allowed; background: #bfbfbf; border-color: #bfbfbf; }

/* 活动任务条 */
.active-tasks {
  background: #fff; border: 1px solid #e8e8e8; border-radius: 6px;
  padding: 12px 14px; margin-bottom: 16px;
}
.active-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #666; margin-bottom: 8px;
}
.active-head a { font-size: 12px; }
.active-list { display: flex; flex-direction: column; gap: 8px; }
.active-row {
  display: grid; grid-template-columns: 80px 1fr 160px 140px 80px;
  gap: 12px; align-items: center; font-size: 12px;
  padding: 8px; background: #fafafa; border-radius: 4px;
}
.active-row .a-id { color: #999; }
.active-row .a-file { font-family: Menlo, monospace; word-break: break-all; }
.active-row .a-bar { background: #e5e5e5; height: 8px; border-radius: 4px; overflow: hidden; }
.active-row .a-bar .fill { background: #1890ff; height: 100%; transition: width .3s; }
.active-row .a-status { text-align: right; color: #333; }

/* 两步确认(内联按钮风格,非弹窗) */
.btn.armed {
  background: #ff4d4f !important; color: #fff !important; border-color: #ff4d4f !important;
  animation: armPulse .6s infinite alternate;
}
@keyframes armPulse { to { background: #cf1322 !important; } }
.pane { background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; display: flex; flex-direction: column; max-height: 520px; }
.pane-head { padding: 12px 14px; border-bottom: 1px solid #eee; }
.pane-head h3 { margin: 0 0 8px; font-size: 15px; }
.pane-head .crumbs { font-size: 13px; color: #666; margin-bottom: 8px; word-break: break-all; }
.pane-head .crumbs span { cursor: pointer; color: #1890ff; }
.pane-head .crumbs span:hover { text-decoration: underline; }
.pane-ops { display: flex; gap: 8px; }
.pane-ops .btn { padding: 4px 10px; font-size: 13px; }

.filelist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.filelist li {
  display: flex; align-items: center; padding: 8px 14px; border-bottom: 1px solid #f5f5f5;
  cursor: pointer; user-select: none;
}
.filelist li:hover { background: #f0f7ff; }
.filelist li.selected { background: #e6f4ff; border-left: 3px solid #1890ff; padding-left: 11px; }
.filelist li .ficon { margin-right: 8px; font-size: 15px; }
.filelist li .fname { flex: 1; word-break: break-all; }
.filelist li .fsize { color: #999; font-size: 12px; margin-left: 8px; }
.filelist li.dir .fname { color: #1890ff; }

.pane-foot { padding: 8px 14px; border-top: 1px solid #eee; background: #fafafa; font-size: 12px; color: #666; }
.pane-foot .sel { font-family: Menlo, monospace; word-break: break-all; }

.actionbar { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.tasks-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; overflow: hidden; }
.tbl th, .tbl td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; font-size: 13px; vertical-align: top; }
.tbl th { background: #fafafa; font-weight: 600; }
.tbl td.small { font-size: 12px; color: #888; }

.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.status.pending { background: #fffbe6; color: #ad6800; }
.status.running { background: #e6f4ff; color: #0958d9; }
.status.success { background: #f6ffed; color: #389e0d; }
.status.failed { background: #fff1f0; color: #cf1322; }
.status.cancelled { background: #f5f5f5; color: #666; }

.pbar { width: 120px; background: #f0f0f0; height: 6px; border-radius: 3px; overflow: hidden; }
.pbar .fill { height: 100%; background: #1890ff; transition: width .3s; }

.detail { background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; margin-top: 14px; padding: 14px; }
.detail.hidden { display: none; }
.detail header { display: flex; justify-content: space-between; align-items: center; }
.detail-meta { font-size: 13px; color: #555; margin: 10px 0; }
.detail pre { background: #263238; color: #e8eaf6; padding: 12px; overflow-x: auto; font-size: 12px; max-height: 400px; border-radius: 4px; }

.hidden { display: none !important; }

.confirm-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.confirm-box {
  background: #fff; min-width: 360px; max-width: 520px;
  border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 20px 22px; animation: confirmIn .15s ease;
}
@keyframes confirmIn { from {transform:translateY(-14px);opacity:0} to{transform:none;opacity:1} }
.confirm-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: #222; }
.confirm-body { font-size: 14px; color: #444; margin-bottom: 20px; line-height: 1.6; word-break: break-all; white-space: pre-line; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
