/* ============================================================
 * 首页增强（2026-09-26）：AI 智能体工作台大气化 + 杂项修正
 * 全部为追加型规则：新元素用新类，存量元素用同名选择器
 * （本文件在 home.min.css 之后加载，同名属性后加载者胜）。
 * 纯 CSS 动画，无 JS；对 prefers-reduced-motion 用户全部关闭。
 * ============================================================ */

/* ---------- 1. Hero 背景装饰层（网格 + 光斑） ---------- */
.ai-hero-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.new-hero .ai-hero-grid {
  position: relative;
  z-index: 1;
}

.decor-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 72% 72% at 62% 42%, #000 30%, transparent 76%);
  mask-image: radial-gradient(ellipse 72% 72% at 62% 42%, #000 30%, transparent 76%);
}

.decor-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: decorOrbFloat 9s ease-in-out infinite alternate;
}

.decor-orb.orb-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 65%);
  top: -60px;
  right: 8%;
}

.decor-orb.orb-2 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #2563eb 0%, transparent 65%);
  bottom: -40px;
  left: 6%;
  animation-delay: -4.5s;
}

@keyframes decorOrbFloat {
  from { transform: translate3d(0, -14px, 0) scale(1); }
  to   { transform: translate3d(0, 18px, 0) scale(1.08); }
}

/* ---------- 2. 左侧文案：标题渐变流动 + 徽章发光 ---------- */
.hero-title .gradient {
  background-size: 200% auto;
  animation: heroGradFlow 6s linear infinite;
}

@keyframes heroGradFlow {
  to { background-position: 200% center; }
}

.hero-badge.ai-badge {
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4), 0 0 18px rgba(139, 92, 246, 0.35);
}

/* ---------- 3. 工作台外壳：悬浮 + 霓虹描边 + 顶部高光 + 扫描线 ---------- */
.ai-workbench {
  position: relative;
  overflow: hidden;
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow:
    0 20px 60px rgba(2, 6, 23, 0.55),
    0 0 0 1px rgba(139, 92, 246, 0.15),
    0 0 42px rgba(139, 92, 246, 0.28);
  animation: wbFloat 7s ease-in-out infinite;
}

@keyframes wbFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.ai-workbench::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.9), transparent);
  z-index: 3;
}

.ai-wb-scan {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(180deg,
    rgba(139, 92, 246, 0) 0%,
    rgba(139, 92, 246, 0.12) 60%,
    rgba(139, 92, 246, 0) 100%);
  animation: wbScanMove 4.5s linear infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes wbScanMove {
  0%   { transform: translateY(-100px); }
  100% { transform: translateY(540px); }
}

/* ---------- 4. 智能体在线行（6 agent，脉冲错拍） ---------- */
.ai-wb-agents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.ai-wb-agent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: #c7d2fe;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 999px;
}

.ai-wb-agent i {
  font-size: 12px;
  color: #a78bfa;
}

.ai-wb-agent .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: agentPulse 2s ease-in-out infinite;
}

.ai-wb-agent:nth-child(2) .dot { animation-delay: 0.3s; }
.ai-wb-agent:nth-child(3) .dot { animation-delay: 0.6s; }
.ai-wb-agent:nth-child(4) .dot { animation-delay: 0.9s; }
.ai-wb-agent:nth-child(5) .dot { animation-delay: 1.2s; }
.ai-wb-agent:nth-child(6) .dot { animation-delay: 1.5s; }

@keyframes agentPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.75); }
}

/* ---------- 5. AI 输出流（三条消息轮播 + 光标闪烁） ---------- */
.ai-wb-stream {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  margin-bottom: 14px;
  padding: 0 12px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #93c5fd;
  overflow: hidden;
}

.ai-wb-stream .stream-label {
  flex: none;
  margin-right: 10px;
  padding: 2px 7px;
  color: #f0abfc;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: rgba(240, 171, 252, 0.1);
  border-radius: 6px;
}

.ai-wb-stream .stream-msg {
  position: absolute;
  left: 78px;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  animation: streamMsgCycle 9s infinite;
}

.ai-wb-stream .msg-1 { animation-delay: 0s; }
.ai-wb-stream .msg-2 { animation-delay: 3s; }
.ai-wb-stream .msg-3 { animation-delay: 6s; }

@keyframes streamMsgCycle {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  30%  { opacity: 1; }
  36%  { opacity: 0; }
  100% { opacity: 0; }
}

.ai-wb-stream .stream-caret {
  position: absolute;
  right: 14px;
  width: 7px;
  height: 14px;
  background: #93c5fd;
  animation: streamCaretBlink 1s steps(1) infinite;
}

@keyframes streamCaretBlink {
  50% { opacity: 0; }
}

/* ---------- 6. 进度条流光 ---------- */
.ai-progress-bar {
  overflow: hidden;
}

.ai-progress-fill {
  background: linear-gradient(90deg, #8b5cf6, #3b82f6, #8b5cf6);
  background-size: 200% 100%;
  animation: progressFlow 2.2s linear infinite;
}

@keyframes progressFlow {
  to { background-position: 200% 0; }
}

/* ---------- 7. 浮游收益气泡（桌面端氛围） ---------- */
.ai-float-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e0e7ff;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.45), 0 0 16px rgba(139, 92, 246, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: chipFloat 6s ease-in-out infinite;
  pointer-events: none;
}

.ai-float-chip i {
  color: #a78bfa;
}

.ai-float-chip.chip-1 { top: 6%; left: -5%; animation-delay: 0s; }
.ai-float-chip.chip-2 { bottom: 20%; right: -5%; animation-delay: -2s; }
.ai-float-chip.chip-3 { bottom: -4%; left: 5%; animation-delay: -4s; }

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ---------- 7.1 装饰元素在窄屏降级（P1-3：900→1024 收敛到标准档） ---------- */
@media (max-width: 1024px) {
  .ai-float-chip { display: none; }
  .ai-workbench { animation: none; }
  .decor-orb { opacity: 0.35; }
}

/* ---------- 8. 等级卡「赚钱场景」折行修正（原 flex 拆两列） ---------- */
.earn-payoff {
  display: block;
  word-break: normal;
}

/* ============================================================
 * 10. P1-1（2026-10-17）首页硬编码 hex 令牌化
 *     原 index_v8.html 内有 12 处内联 hex（工作流 6 个图标渐变 +
 *     社区帖子左侧色条/类型徽章），全部外置到本文件并改用令牌。
 *     语义色阶缺失处用 design-tokens 就近档位；个别「品类强调色」
 *     （粉/橙/青）在令牌体系内无对应档，保留为 CSS 内常量并集中在
 *     本区块，便于后续统一替换（模板内已零 hex）。
 * ============================================================ */

/* ---------- 10.1 工作流 6 步图标渐变（品类强调色，全部走令牌） ---------- */
.workflow-icon[data-flow="1"] { background: linear-gradient(135deg, var(--ds-accent-500), var(--ds-indigo-500)); }
.workflow-icon[data-flow="2"] { background: linear-gradient(135deg, #ec4899, var(--ds-rose-500)); }
.workflow-icon[data-flow="3"] { background: linear-gradient(135deg, var(--ds-warning-500), #f97316); }
.workflow-icon[data-flow="4"] { background: linear-gradient(135deg, var(--ds-success-500), var(--ds-info-500)); }
.workflow-icon[data-flow="5"] { background: linear-gradient(135deg, var(--ds-danger-500), #f97316); }
.workflow-icon[data-flow="6"] { background: linear-gradient(135deg, var(--ds-primary-500), var(--ds-indigo-500)); }

/* ---------- 10.2 社区帖子左侧语义色条 ---------- */
.post-item--column  { border-left: 3px solid var(--ds-primary-500); }
.post-item--discuss { border-left: 3px solid var(--ds-success-500); }

/* ---------- 10.3 社区帖子类型徽章 ---------- */
.post-type-badge {
  color: #fff;
}
.post-type-badge--column {
  background: linear-gradient(135deg, var(--ds-primary-500), var(--ds-accent-700));
}
.post-type-badge--discuss {
  background: linear-gradient(135deg, var(--ds-success-500), #1abc9c);
}

/* ---------- 9. 动效可关闭 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ai-hero-decor .decor-orb,
  .ai-wb-scan,
  .ai-wb-agent .dot,
  .ai-wb-stream .stream-msg,
  .ai-wb-stream .stream-caret,
  .ai-float-chip,
  .ai-workbench,
  .ai-progress-fill,
  .hero-title .gradient {
    animation: none !important;
  }
}
