/* ui.css — 跨页通用组件：统一 toast 反馈 + 空状态图标（P2-2 / P2-3） */

/* ---------- 统一 toast ---------- */
.toast-layer {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 200px;
  max-width: 90vw;
  padding: 10px 14px;
  border-radius:var(--r);
  font-size: var(--fs-label);
  line-height: 1.5;
  color: var(--on-brand);
  background: var(--text);
  box-shadow: var(--shadow-pop);
  animation: toastIn var(--motion-normal) var(--motion-ease) both;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--text); }
.toast.out { animation: toastOut var(--motion-fast) var(--motion-ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- 空状态（图标 + 文案） ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: 18px 0;
  color: var(--text-muted);
  font-size: var(--fs-caption);
  text-align: center;
  line-height: 1.6;
}
.empty-state svg { width: 40px; height: 40px; opacity: .7; flex-shrink: 0; }

/* ---------- 统一三态（loading / empty / error）2026-08-15 P0 ----------
   视觉上明确分离中间态与终态：loading=动效 spinner；empty=中性灰；
   error=警告色，带重试入口。 */
.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-caption);
  line-height: 1.6;
}
.state-block svg { width: 40px; height: 40px; flex-shrink: 0; }
.state-loading svg, .state-loading .spinner { color: var(--brand, #c2410c); }
.state-empty svg { opacity: .65; }
.state-error { color: var(--danger, #dc2626); }
.state-error svg { color: var(--danger, #dc2626); opacity: .9; }
.state-text { margin: 0; }
.state-title { margin: 0; font-weight: 600; color: inherit; }
.state-desc { margin: 0; font-size: var(--fs-caption); opacity: .85; }
.state-block .primary { margin-top: 6px; }

/* 加载态 spinner（替代灰色「加载中…」小字，消除 CLS 与歧义） */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-strong, #d8d6d2);
  border-top-color: var(--brand, #c2410c);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  box-sizing: border-box;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   v3 通用组件(方案 B 排版 + 应用胶囊卡片)
   ============================================================ */

/* 数字等宽工具类:金额/时间一律加这个,金融感核心 */
.num-tabular { font-variant-numeric: tabular-nums; font-family: var(--font-num); letter-spacing: var(--tracking-num); }

/* 应用胶囊卡片(参考 v3 预览"应用中心"风格) */
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 1100px) { .app-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .app-grid { grid-template-columns: repeat(2, 1fr); } }

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  transition: all var(--motion-fast) var(--motion-ease);
  cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: var(--sp-3);
  min-height: 124px;
}
.app-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.app-card .head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.app-card .ic-tile {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: 0 0 44px;
}
.app-card .ic-tile.blue { background: var(--c-blue-soft); color: var(--c-blue); }
.app-card .ic-tile.green { background: var(--c-green-soft); color: var(--c-green); }
.app-card .ic-tile.red { background: var(--c-red-soft); color: var(--c-red); }
.app-card .ic-tile.amber { background: var(--c-amber-soft); color: var(--c-amber-text); }
.app-card .ic-tile.violet { background: var(--c-violet-soft); color: var(--c-violet); }
.app-card .ic-tile.cyan { background: var(--c-cyan-soft); color: var(--c-cyan); }
.app-card .ic-tile.pink { background: var(--c-pink-soft); color: var(--c-pink); }
.app-card .ic-tile.brand { background: var(--brand-soft); color: var(--brand); }
.app-card .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-card .meta .t {
  font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--text);
  letter-spacing: var(--tracking-snug);
}
.app-card .meta .s {
  font-size: var(--fs-micro); color: var(--text-muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.app-card .meta .status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--info); font-weight: var(--fw-medium);
  margin-top: 2px;
}
.app-card .meta .status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.app-card .meta .status.ok { color: var(--success-text); }
.app-card .meta .status.warn { color: var(--warning); }
.app-card .meta .status.danger { color: var(--danger); }
.app-card .corner { position: absolute; top: var(--sp-4); right: var(--sp-4); display: flex; align-items: center; gap: 4px; }
.app-card .bal {
  font-size: 11px; font-weight: var(--fw-semibold); color: var(--info);
  padding: 2px 8px; border-radius: 99px; background: var(--info-soft);
}
.app-card .ed {
  width: 22px; height: 22px; border-radius: var(--r-sm);
  background: transparent; border: none; color: var(--text-subtle);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px;
}
.app-card .ed:hover { background: var(--bg); color: var(--text); }

/* 分组标题(应用中心页用) */
.grp-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--sp-7) 0 var(--sp-3);
}
.grp-hd .t {
  font-size: 13px; font-weight: var(--fw-semibold); color: var(--text);
  letter-spacing: 0.02em;
}
.grp-hd .more { font-size: var(--fs-micro); color: var(--text-muted); cursor: pointer; }
.grp-hd .more:hover { color: var(--brand); }


