/* Content Agent 发布台 · 进度面板、通知、弹窗、浏览器与插件引导 */

/* ---------- 执行进度 ---------- */
@property --ring { syntax: "<number>"; inherits: true; initial-value: 0; }
.progress-card { margin-top: 20px; }
.ring {
  --ring: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--ring) * 1%), var(--surface-3) 0);
  transition: --ring 0.8s var(--ease);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 11.5px; font-weight: 680; font-variant-numeric: tabular-nums; }
.run-list { display: grid; gap: 10px; }
.run {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: rise 0.45s var(--ease) both;
}
.run-head { display: flex; align-items: center; gap: 10px; }
.run-head .mono { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
.run-name { font-weight: 620; }
.run-head .badge { margin-left: auto; }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 8px; }
.stage { display: grid; gap: 5px; font-size: 11px; color: var(--text-3); }
.stage i { position: relative; display: block; height: 4px; overflow: hidden; border-radius: 99px; background: var(--surface-3); transition: background 0.3s; }
.stage.done, .stage.active { color: var(--text-2); }
.stage.done i { background: var(--ok); }
.stage.active i { background: var(--accent-soft); }
.stage.active i::after { content: ""; position: absolute; inset: 0; width: 42%; border-radius: inherit; background: var(--accent); animation: indeterminate 1.4s var(--ease) infinite; }
.stage.waiting i { background: var(--warn); }
.stage.error i { background: var(--err); }
.stage.error { color: var(--err); }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.run-message { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); word-break: break-word; }
.run-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.run-log summary { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); cursor: pointer; list-style: none; }
.run-log summary::-webkit-details-marker { display: none; }
.run-log summary svg { width: 12px; height: 12px; transition: transform 0.25s var(--ease); }
.run-log[open] summary svg { transform: rotate(90deg); }
.run-log ol {
  display: grid;
  gap: 4px;
  max-height: 220px;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  list-style: none;
}
.run-log time { margin-right: 8px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 26px 12px 14px; color: var(--text-3); text-align: center; }
.empty-state svg { width: 96px; height: 72px; margin-bottom: 6px; }
.empty-state strong { color: var(--text-2); font-weight: 600; }

/* ---------- 通知 ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: grid; justify-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 94%, transparent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 540;
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  animation: toast-in 0.45s var(--spring);
}
.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }
.toast .dot { color: var(--accent); }
.toast.ok .dot { color: var(--ok); }
.toast.warn .dot { color: var(--warn); }
.toast.err .dot { color: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- 弹窗 ---------- */
dialog.sheet { width: 100%; max-width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: visible; border: 0; background: transparent; color: inherit; }
dialog.sheet::backdrop { background: rgba(10, 10, 24, 0.32); backdrop-filter: blur(10px); }
dialog.sheet[open] { animation: sheet-in 0.5s var(--spring); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.sheet-card {
  position: relative;
  max-height: calc(100vh - 40px);
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.sheet-card:focus { outline: none; }
.sheet-close { position: absolute; top: 16px; right: 16px; }
.sheet-hero { display: flex; align-items: center; gap: 16px; margin: 0 40px 22px 0; }
.glyph { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--accent-grad); color: #fff; box-shadow: 0 14px 28px -14px rgba(91, 91, 246, 0.7); }
.glyph svg { width: 26px; height: 26px; }
.glyph img { width: 56px; height: 56px; }
.sheet-hero h2 { margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.sheet-hero p { margin: 4px 0 0; color: var(--text-2); }

.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface-2); counter-increment: step; }
.step::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 680; box-shadow: var(--shadow-card); }
.step h3 { margin: 5px 0 4px; font-size: 14px; font-weight: 640; }
.step p { margin: 0; font-size: 13px; color: var(--text-2); }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kbd { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); font: 12px ui-monospace, "SF Mono", Menlo, monospace; }
.fake-ui { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 12.5px; }
.fake-ui .switch-track { width: 34px; height: 20px; background: var(--accent); }
.fake-ui .switch-track::after { width: 14px; height: 14px; transform: translateX(14px); }
.fake-ui .btn { pointer-events: none; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.waiting { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--text-2); font-size: 13px; }
.waiting .spinner { color: var(--accent); }
.download-missing { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }

/* ---------- 浏览器检测 ---------- */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px); animation: fade-in 0.3s var(--ease); }
.gate-card { width: min(520px, 100%); padding: 36px 32px 28px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-pop); text-align: center; animation: sheet-in 0.55s var(--spring); }
.gate-art { position: relative; width: 96px; height: 96px; margin: 0 auto 20px; }
.gate-art .glyph { width: 96px; height: 96px; border-radius: 30px; }
.gate-art .glyph svg { width: 44px; height: 44px; }
.gate-art .badge { position: absolute; right: -14px; bottom: -8px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-card); }
.gate h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.03em; text-wrap: balance; }
.gate p { margin: 0 auto 22px; max-width: 400px; color: var(--text-2); text-wrap: pretty; }
@media (max-width: 480px) {
  .gate-card { padding: 28px 20px 22px; border-radius: 26px; }
  .gate h2 { font-size: 21px; }
  .gate-row { grid-template-columns: minmax(0, 1fr); }
}
.gate-actions { display: grid; gap: 10px; }
.gate-actions .btn-primary { text-decoration: none; }
.gate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate-detected { margin: 18px 0 0; font-size: 12px; color: var(--text-3); }
