/* 与飞同行 · 统一任务进度 / 按钮秒级响应层（v206，2026-10-02）
 * 只做视觉：右下角任务进度卡、按钮点击回执、按钮忙碌态。删这一行即整体回退。
 * 元素由 js/task-progress.js 生成，类名一律 yftx-task-* / is-ack / is-busy，不碰任何既有类。
 */

/* ---------- ① 点击立即回执：任何按钮按下去当场有反应 ---------- */
.yftx-ack-host, button.is-ack, [role="button"].is-ack, .prep-btn.is-ack,
.collector-button.is-ack, .page-clear-button.is-ack, .modal-btn.is-ack,
label.prep-file.is-ack {
  animation: yftxAckPress 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

button.is-ack::after, [role="button"].is-ack::after, .prep-btn.is-ack::after,
.collector-button.is-ack::after, .page-clear-button.is-ack::after,
.modal-btn.is-ack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 68%);
  animation: yftxAckRipple 420ms ease-out both;
}

@keyframes yftxAckPress {
  0% { transform: scale(1); }
  38% { transform: scale(0.965); }
  100% { transform: scale(1); }
}

@keyframes yftxAckRipple {
  0% { opacity: 0.85; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.18); }
}

/* 回执动画需要按钮自身能定位，否则水波会跑到别处；只给相对定位，不动尺寸。 */
button.is-ack, [role="button"].is-ack, .prep-btn.is-ack, .collector-button.is-ack,
.page-clear-button.is-ack, .modal-btn.is-ack { position: relative; overflow: hidden; }

/* ---------- ② 按钮忙碌态：转圈 + 半透明，文字保留（由 JS 换成「处理中…」） ---------- */
button.is-busy, [role="button"].is-busy, .prep-btn.is-busy, .collector-button.is-busy {
  cursor: progress !important;
  opacity: 0.82;
}

button.is-busy::before, [role="button"].is-busy::before, .prep-btn.is-busy::before,
.collector-button.is-busy::before {
  content: "";
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  margin-right: 0.42em;
  vertical-align: -0.08em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.9;
  animation: yftxSpin 720ms linear infinite;
}

@keyframes yftxSpin { to { transform: rotate(360deg); } }

/* ---------- ③ 右下角任务进度卡 ---------- */
.yftx-task-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(300px, calc(100vw - 32px));
  pointer-events: none;
}

.yftx-task-card {
  pointer-events: auto;
  box-sizing: border-box;
  padding: 10px 12px 9px;
  border-radius: 12px;
  background: rgba(28, 32, 40, 0.88);
  color: #eef2f7;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 22px rgba(8, 12, 20, 0.26);
  backdrop-filter: blur(8px);
  font: 500 12.5px/1.45 -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  animation: yftxCardIn 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.yftx-task-card[data-state="done"] { border-color: rgba(72, 199, 142, 0.55); }
.yftx-task-card[data-state="error"] { border-color: rgba(240, 106, 106, 0.6); }

@keyframes yftxCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.yftx-task-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yftx-task-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #57b6ff;
  box-shadow: 0 0 0 0 rgba(87, 182, 255, 0.55);
  animation: yftxTaskPulse 1.5s ease-out infinite;
}

.yftx-task-card[data-state="done"] .yftx-task-dot { background: #48c78e; animation: none; }
.yftx-task-card[data-state="error"] .yftx-task-dot { background: #f06a6a; animation: none; }

@keyframes yftxTaskPulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 182, 255, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(87, 182, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 182, 255, 0); }
}

.yftx-task-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yftx-task-close {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 20px;
  text-align: center;
  border-radius: 7px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: #cfd7e3;
  font-size: 15px;
  cursor: pointer;
}

.yftx-task-close:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

.yftx-task-track {
  position: relative;
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.yftx-task-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4aa8ff, #7ee0c0);
  transition: width 260ms ease-out;
}

.yftx-task-card[data-state="done"] .yftx-task-fill { background: linear-gradient(90deg, #36c98a, #9ff0c4); }
.yftx-task-card[data-state="error"] .yftx-task-fill { background: linear-gradient(90deg, #e35757, #ffa8a8); }

.yftx-task-track.is-indeterminate .yftx-task-fill {
  width: 100% !important;
  background: linear-gradient(90deg, rgba(74, 168, 255, 0.25), #4aa8ff, rgba(74, 168, 255, 0.25));
  background-size: 220% 100%;
  animation: yftxTaskFlow 1.15s linear infinite;
}

@keyframes yftxTaskFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: -220% 50%; }
}

.yftx-task-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

.yftx-task-count { font-weight: 650; font-size: 12.5px; color: #ffffff; }
.yftx-task-eta { font-size: 11px; color: #9fb0c6; white-space: nowrap; }

.yftx-task-note {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: #a9b8cc;
  word-break: break-word;
  max-height: 4.2em;
  overflow: hidden;
}

.yftx-task-card[data-state="error"] .yftx-task-note { color: #ffb3b3; }
.yftx-task-card[data-state="done"] .yftx-task-note { color: #a9e8c8; }

.yftx-task-actions { margin-top: 9px; display: flex; justify-content: flex-end; }

.yftx-task-cancel {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: #e6ecf5;
  font-size: 12px;
  cursor: pointer;
}

.yftx-task-cancel:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.yftx-task-cancel:disabled { opacity: 0.55; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  button.is-ack, [role="button"].is-ack, .prep-btn.is-ack, .collector-button.is-ack,
  .page-clear-button.is-ack, .modal-btn.is-ack, label.prep-file.is-ack { animation: none; }
  button.is-ack::after, [role="button"].is-ack::after, .prep-btn.is-ack::after,
  .collector-button.is-ack::after, .page-clear-button.is-ack::after,
  .modal-btn.is-ack::after { display: none; }
  button.is-busy::before, [role="button"].is-busy::before, .prep-btn.is-busy::before,
  .collector-button.is-busy::before { animation-duration: 1.6s; }
  .yftx-task-dot { animation: none; }
  .yftx-task-track.is-indeterminate .yftx-task-fill { animation-duration: 2.4s; }
  .yftx-task-card { animation: none; }
}
/* ---------------------------------------------------------------------------
 * 2026-10-03（第一百三十八批 · D 组现场纠偏）：右下角进度卡也改成「浅色小卡片」。
 * 老板原话「这种弹窗弹的没意义，而且半天了还一直在，很低级」——
 * 结构上已经加了寿命上限（JS 侧），这里只把观感从「深色大黑卡」压成安静的浅色卡片：
 * 白底、细边、左对齐、最多两行；完成后 3 秒自己消失。
 * 只追加覆盖，不动任何既有规则；删掉这一段即回退成原来的深色卡。
 * ------------------------------------------------------------------------- */
.yftx-task-stack { width: min(268px, calc(100vw - 28px)); gap: 8px; }

.yftx-task-card {
  padding: 9px 11px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  color: #23303c;
  border: 1px solid rgba(24, 38, 54, 0.10);
  box-shadow: 0 4px 14px rgba(16, 26, 40, 0.10);
  backdrop-filter: blur(4px);
  font: 500 12px/1.4 -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  animation-duration: 180ms;
}

.yftx-task-card[data-state="done"] { border-color: rgba(46, 168, 118, 0.35); }
.yftx-task-card[data-state="error"] { border-color: rgba(214, 92, 92, 0.38); }

.yftx-task-label { font-weight: 600; font-size: 12px; color: #23303c; }

.yftx-task-close {
  width: 18px; height: 18px; line-height: 16px; border-radius: 6px;
  background: transparent; color: #93a2b1; font-size: 13px;
}
.yftx-task-close:hover { background: rgba(24, 38, 54, 0.07); color: #3a4a5a; }

.yftx-task-track { height: 3px; margin-top: 7px; background: rgba(24, 38, 54, 0.09); }
.yftx-task-fill { background: linear-gradient(90deg, #7fb6ff, #86d9bd); }
.yftx-task-card[data-state="done"] .yftx-task-fill { background: #48c78e; }

.yftx-task-meta { color: #77869a; font-size: 11px; }
.yftx-task-note { color: #66768a; font-size: 11px; }
.yftx-task-dot { width: 7px; height: 7px; background: #6aa9f0; }
.yftx-task-card[data-state="done"] .yftx-task-dot { background: #48c78e; }
.yftx-task-cancel {
  border-radius: 7px; border: 1px solid rgba(24, 38, 54, 0.14);
  background: #fff; color: #3a4a5a; font-size: 11px;
}