/* ==========================================================================
   components-feedback.css  |  「6」v7.0 组件层（状态点 / 骨架 / 面板 / 空态 / 错误 / Toast / 命令面板）
   --------------------------------------------------------------------------
   components.css 拆分件之一（与 components-form.css 同源，base.html 引入顺序不变）。
   只引用 semantic/component Token，零硬编码 hex。焦点环统一
   box-shadow: 0 0 0 3px var(--focus-ring)。
   ========================================================================== */

/* ---- 状态点（3.4：颜色 + 文字双编码）---- */
.dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex-shrink: 0; background: var(--status-queued); }
.dot-building { background: var(--status-building); animation: dot-pulse 1.8s var(--ease-standard) infinite; }
.dot-ready { background: var(--status-ready); }
.dot-error { background: var(--status-error); }
.dot-canceled { background: var(--status-canceled); }
.dot-stopped { background: var(--status-queued); }
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.status-line { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--muted); }
.status-line .dot { width: 8px; height: 8px; }
.status-line .status-text { color: var(--fg-2); }
@media (prefers-reduced-motion: reduce) {
  .dot-building { animation: none; }
}

/* ---- 骨架屏（Loading）---- */
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: skel-shine 1.4s var(--ease-linear) infinite;
}
@keyframes skel-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-row { height: 40px; margin-bottom: var(--space-2); }
.skel-row:last-child { margin-bottom: 0; }

/* ---- 面板卡（新组件统一入口；密度 7：padding 16px + 1px 边框）---- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-4);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin: calc(-1 * var(--space-1)) 0 var(--space-3);
}
.panel-title {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin: 0;
  font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--fg);
}
.panel-title svg { width: 20px; height: 20px; color: var(--muted); }
.panel-more { font-size: var(--text-xs); color: var(--muted); }
.panel-more a { color: var(--accent-text); text-decoration: none; }
.panel-more a:hover { text-decoration: underline; }

/* 数据行：1px 分隔线分组而非卡片盒子（DENSITY 7）*/
.data-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.data-row:last-child { border-bottom: none; }
.data-row-click { cursor: pointer; border-radius: var(--radius-sm); transition: background-color var(--duration-base) var(--ease-standard); }
.data-row-click:hover { background: var(--surface-warm); }
.data-name { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-meta { font-size: var(--text-xs); color: var(--meta); white-space: nowrap; }
.data-acts { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* ---- 空状态卡（3.8）---- */
.empty-card {
  max-width: 480px; margin: 0 auto; text-align: center;
  padding: var(--space-10) var(--space-4);
}
.empty-icon {
  width: 48px; height: 48px; margin: 0 auto var(--space-4);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border-radius: var(--radius-pill);
}
.empty-icon svg { width: 24px; height: 24px; color: var(--accent-text); }
.empty-title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--fg); margin: 0 0 var(--space-2); }
.empty-desc { font-size: var(--text-sm); color: var(--muted); margin: 0 0 var(--space-5); line-height: var(--leading-body); }
.empty-acts { display: flex; align-items: center; justify-content: center; gap: var(--space-2); flex-wrap: wrap; }
@media (max-width: 767px) {
  .empty-card { padding: var(--space-8) var(--space-4); }
  .empty-icon { width: 40px; height: 40px; }
  .empty-acts { flex-direction: column; }
  .empty-acts .btn { width: 100%; }
}

/* ---- 区块级 Error（就近展示 + 具体原因 + 重试）---- */
.block-error {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  background: var(--danger-soft); color: var(--danger-text);
  border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.block-error svg { width: 16px; height: 16px; flex-shrink: 0; }
.block-error .btn { margin-left: auto; }

/* ---- Toast（role=status，--z-toast）---- */
#toastRegion {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  z-index: var(--z-toast); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-raised);
  padding: var(--space-2) var(--space-4); font-size: var(--text-sm);
  animation: toast-in var(--duration-slow) var(--ease-standard);
}
.toast svg { width: 16px; height: 16px; color: var(--success-text); }
.toast.is-error svg { color: var(--danger-text); }
.toast.is-leaving { opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ==========================================================================
   命令面板（3.7：Raycast 五要素）
   1) 搜索框自动聚焦  2) 分组结果  3) 键盘导航  4) 高亮+右侧类型图标
   5) 空状态 + 页脚提示
   ========================================================================== */
.cmdk-overlay {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--section-y-phone) var(--space-4) var(--space-4);
  z-index: var(--z-modal);
}
.cmdk-overlay[hidden] { display: none; }
.cmdk-panel {
  width: 100%; max-width: 640px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 2 * var(--space-8)));
  overflow: hidden;
  animation: cmdk-in var(--duration-slowest) var(--ease-standard);
}
@keyframes cmdk-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .cmdk-panel { animation: none; } }
.cmdk-input-row {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}
.cmdk-input-row > svg, .cmdk-input-row .i16 { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.cmdk-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--fg); font-family: inherit; font-size: var(--text-base);
}
.cmdk-input::placeholder { color: var(--meta); }
.cmdk-input:focus-visible { box-shadow: none; }   /* 面板级焦点环已由面板承担 */
.cmdk-spinner { display: inline-flex; color: var(--muted); }
.cmdk-spinner svg { animation: btn-spin 0.7s var(--ease-linear) infinite; }
.cmdk-results { overflow-y: auto; padding: var(--space-2); }
.cmdk-group-label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-2xs); font-weight: var(--weight-medium);
  color: var(--meta); letter-spacing: var(--tracking-caps);
}
.cmdk-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  cursor: pointer; min-width: 0;
  color: var(--fg-2);
}
.cmdk-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.cmdk-item-body { flex: 1; min-width: 0; }
.cmdk-item-title { font-size: var(--text-sm); color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-sub { font-size: var(--text-2xs); color: var(--meta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.cmdk-item-hint { font-size: var(--text-2xs); color: var(--meta); white-space: nowrap; flex-shrink: 0; }
.cmdk-item-hint svg { width: 14px; height: 14px; }
.cmdk-item:hover, .cmdk-item.is-active { background: var(--surface-warm); }
.cmdk-item.is-active svg { color: var(--fg-2); }
.cmdk-item[aria-disabled="true"] { color: var(--meta); cursor: default; }
.cmdk-item[aria-disabled="true"] .cmdk-item-title { color: var(--meta); }
.cmdk-item[aria-disabled="true"]:hover { background: transparent; }
.cmdk-empty { padding: var(--space-8) var(--space-4); text-align: center; }
.cmdk-empty-title { font-size: var(--text-sm); color: var(--fg-2); margin-bottom: var(--space-1); }
.cmdk-empty-sub { font-size: var(--text-xs); color: var(--meta); }
.cmdk-empty .btn { margin-top: var(--space-3); }
.cmdk-inline-error {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin: var(--space-1) var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger-text); font-size: var(--text-xs);
}
.cmdk-inline-error svg { width: 14px; height: 14px; }
.cmdk-footer {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border-soft);
  font-size: var(--text-2xs); color: var(--meta);
}
.cmdk-footer span { display: inline-flex; align-items: center; gap: var(--space-1); }
.cmdk-footer .kbd { padding: 1px 5px; }
