/*
 * 视栈科技 · 企业全栈工作流系统 —— 首页专属样式
 *
 * 为什么不直接往 styles.css 里追加：
 * 1) styles.css 是全站（首页 / console / control-center / admin）共用文件，3800+ 行，
 *    把首页新板块混进去会让"以后要摘掉 AI 首页"变成一次外科手术；
 * 2) 独立文件 + 首页模式开关配套：切回 legacy 首页时这个文件根本不 link，零副作用；
 * 3) 只使用 styles.css 已定义的 CSS 变量（--bg/--panel/--line/--text/--muted/--accent），
 *    新增的紫色/绿色限定在 .wf-* 作用域内，不污染全局主题。
 */

/* 工作流板块专用色：紫=AI 自动化，绿=数据与收益，与 PPT 配色保持一致 */
:root {
  --wf-violet: #a855f7;
  --wf-green: #a3e635;
  --wf-warm: #fbbf24;
  --wf-rose: #fb7185;
}

/* ---------------------------------------------------------------- 通用外壳 */
.wf-section {
  padding: 40px 0;
}

/* 卡片统一走"深色玻璃 + 细描边 + 顶部霓虹条"，与 PPT 的卡片语言对齐 */
.wf-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(27, 42, 74, 0.92), rgba(12, 18, 37, 0.94));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease;
}

.wf-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 46px;
  height: 4px;
  border-radius: 0 0 4px 0;
  background: var(--accent);
}

.wf-card:hover {
  transform: translateY(-4px);
  border-color: rgba(68, 208, 255, 0.42);
}

.wf-card.tone-warm::before { background: var(--wf-warm); }
.wf-card.tone-violet::before { background: var(--wf-violet); }
.wf-card.tone-green::before { background: var(--wf-green); }
.wf-card.tone-rose::before { background: var(--wf-rose); }

.wf-card h3 {
  margin: 14px 0 8px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.wf-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.wf-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* 结论条：每节收尾用一句话把信息收敛，避免只堆功能 */
.wf-note {
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(68, 208, 255, 0.28);
  border-radius: 18px;
  background: rgba(68, 208, 255, 0.07);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.wf-note strong { color: var(--accent); }

/* ---------------------------------------------------------------- 痛点网格 */
.wf-pain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.wf-pain-metric {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.wf-pain-metric strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.wf-pain-metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.wf-pain-grid .tone-warm .wf-pain-metric strong { color: var(--wf-warm); }
.wf-pain-grid .tone-accent .wf-pain-metric strong { color: var(--accent); }

/* ---------------------------------------------------------------- 四层架构 */
.wf-arch {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: start;
}

.wf-layer {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(27, 42, 74, 0.9), rgba(12, 18, 37, 0.92));
}

.wf-layer + .wf-layer { margin-top: 12px; }

.wf-layer-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 18px;
  font-weight: 800;
}

.wf-layer-name small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wf-layer p {
  margin: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.wf-principle { padding: 18px 20px; }

.wf-principle h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--accent);
}

/* ---------------------------------------------------------------- 能力矩阵 */
.wf-cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.wf-cap-no {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.wf-cap-grid .tone-violet .wf-cap-no { color: var(--wf-violet); }
.wf-cap-grid .tone-green .wf-cap-no { color: var(--wf-green); }
.wf-cap-grid .tone-warm .wf-cap-no { color: var(--wf-warm); }
.wf-cap-grid .tone-rose .wf-cap-no { color: var(--wf-rose); }

.wf-cap-points {
  margin: 16px 0 0;
  padding: 14px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.wf-cap-points li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.wf-cap-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------------------------------------------------------------- 双栏（AI 员工 / 治理） */
.wf-two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  align-items: start;
}

.wf-elem {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
}

.wf-elem + .wf-elem { margin-top: 16px; }

.wf-elem-no {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(68, 208, 255, 0.45);
  border-radius: 11px;
  background: rgba(68, 208, 255, 0.12);
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

.wf-elem h4 {
  margin: 4px 0 4px;
  font-size: 16px;
}

.wf-elem p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- 表格（对照表 / 测算表） */
.wf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.wf-table caption {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  text-align: left;
}

.wf-table th,
.wf-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  line-height: 1.6;
}

.wf-table thead th {
  border-bottom-color: rgba(68, 208, 255, 0.4);
  background: rgba(68, 208, 255, 0.08);
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.wf-table tbody th {
  color: var(--text);
  font-weight: 700;
}

.wf-table td { color: var(--muted); }

.wf-table td.num,
.wf-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.wf-table tbody tr:hover td,
.wf-table tbody tr:hover th { background: rgba(255, 255, 255, 0.03); }

/* 合计行：用收益绿，与"省下来的钱"语义一致 */
.wf-table tfoot th,
.wf-table tfoot td {
  border-bottom: none;
  background: rgba(163, 230, 53, 0.1);
  color: var(--wf-green);
  font-weight: 800;
  font-size: 15px;
}

.wf-table .delta { color: var(--wf-green); font-weight: 700; }

/* ---------------------------------------------------------------- 七步流水线 */
.wf-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.wf-step {
  position: relative;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(27, 42, 74, 0.92), rgba(12, 18, 37, 0.94));
}

/* 步骤间的箭头：用伪元素画一个 chevron，避免额外 DOM 与图片 */
.wf-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(68, 208, 255, 0.6);
  border-right: 2px solid rgba(68, 208, 255, 0.6);
  transform: translateY(-50%) rotate(45deg);
  z-index: 2;
}

.wf-step h4 {
  margin: 12px 0 6px;
  font-size: 15px;
}

.wf-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.wf-who {
  display: inline-flex;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.wf-step.tone-accent { --wf-step-color: var(--accent); }
.wf-step.tone-violet { --wf-step-color: var(--wf-violet); }
.wf-step.tone-warm { --wf-step-color: var(--wf-warm); }
.wf-step.tone-green { --wf-step-color: var(--wf-green); }

.wf-step .wf-who { color: var(--wf-step-color, var(--accent)); }

/* ---------------------------------------------------------------- 指标与收益 */
.wf-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.wf-metric {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(27, 42, 74, 0.9), rgba(12, 18, 37, 0.92));
}

.wf-metric strong {
  display: block;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.wf-metric strong small {
  margin-left: 4px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
}

.wf-metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.wf-metric.tone-green strong { color: var(--wf-green); }
.wf-metric.tone-violet strong { color: var(--wf-violet); }

.wf-beyond-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.wf-beyond-big {
  margin: 12px 0 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}

.wf-beyond-grid .tone-green .wf-beyond-big { color: var(--wf-green); }
.wf-beyond-grid .tone-violet .wf-beyond-big { color: var(--wf-violet); }
.wf-beyond-grid .tone-warm .wf-beyond-big { color: var(--wf-warm); }

/* ---------------------------------------------------------------- 权限优先级链 */
.wf-chain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wf-chain li {
  position: relative;
  padding: 9px 0 9px 40px;
  font-size: 14px;
}

/* 序号圆点 + 竖向连线：把"优先级从高到低"画成一条链，比纯文字更直观 */
.wf-chain li::before {
  content: attr(data-i);
  position: absolute;
  left: 0;
  top: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(68, 208, 255, 0.45);
  border-radius: 50%;
  background: rgba(68, 208, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.wf-chain li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 36px;
  width: 1px;
  height: 12px;
  background: var(--line);
}

/* ---------------------------------------------------------------- 90 天路径 */
.wf-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.wf-stage-phase {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wf-stage-list {
  margin: 14px 0 0;
  padding: 14px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.wf-stage-list li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.wf-stage-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.wf-accept {
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(68, 208, 255, 0.32);
  border-radius: 14px;
  background: rgba(68, 208, 255, 0.08);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}

.wf-stage-grid .tone-green .wf-stage-phase,
.wf-stage-grid .tone-green .wf-accept { color: var(--wf-green); }
.wf-stage-grid .tone-green .wf-accept { border-color: rgba(163, 230, 53, 0.35); background: rgba(163, 230, 53, 0.08); }
.wf-stage-grid .tone-green .wf-stage-list li::before { background: var(--wf-green); }
.wf-stage-grid .tone-violet .wf-stage-phase,
.wf-stage-grid .tone-violet .wf-accept { color: var(--wf-violet); }
.wf-stage-grid .tone-violet .wf-accept { border-color: rgba(168, 85, 247, 0.35); background: rgba(168, 85, 247, 0.08); }
.wf-stage-grid .tone-violet .wf-stage-list li::before { background: var(--wf-violet); }

.wf-deliverables {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.wf-deliverables strong { color: var(--accent); }

/* ---------------------------------------------------------------- 收尾 CTA */
.wf-cta {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 34px;
  border: 1px solid rgba(68, 208, 255, 0.28);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 20%, rgba(68, 208, 255, 0.18), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(168, 85, 247, 0.16), transparent 46%),
    linear-gradient(140deg, rgba(11, 20, 38, 0.96), rgba(6, 12, 24, 0.96));
}

.wf-slogan {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.wf-slogan em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--wf-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wf-principle h3,
.wf-principle h4 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--accent);
}

/* ---------------------------------------------------------------- 局部间距与尺寸修正 */
/* 流水线后的对比表：与上方步骤卡拉开间距（以前写在 HTML 的 style 里，集中回 CSS 便于统一调整） */
.wf-card-after-flow { margin-top: 20px; }

/* ROI 指标在窄栏里改成单列堆叠 */
.wf-metric-col {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 16px;
}

.wf-subhead { margin-top: 34px; }

.wf-subhead-title { font-size: clamp(24px, 3vw, 34px); }

/* 治理条目卡片纵向堆叠时的间距 */
.wf-gov-list .wf-card + .wf-card { margin-top: 12px; }

/* 卡片内嵌的结论条：不需要外边距，字号也小一号 */
.wf-note-inline {
  margin-top: 14px;
  font-size: 13.5px;
}

/* “为什么选视栈”是 4 张卡，不是能力矩阵的 6 张 */
.wf-why-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.wf-cta-desc {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.wf-cta-actions { margin-top: 18px; }

/* ---------------------------------------------------------------- Hero 微调（仅限 AI 首页） */
/* 以下规则必须带 .home-ai 前缀：.hero-title / .signal-grid / .hero-panel 在旧首页（legacy 分支）里同样存在，
   不加限定会让“切回旧首页”后的观感被改动，违背“只改首页且可一键回滚”的前提 */
.home-ai .hero-title { max-width: 16ch; }

/* 右侧面板：.hero 是 stretch 的 grid，不居中会让两块内容被 100vh 拉出大片空洞 */
.home-ai .hero .hero-panel { align-content: center; }

/* 信号格：AI 首页只有 3 个指标，改成 3 列一行并收紧内边距与字号 */
.home-ai .hero .signal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-ai .hero .signal-grid article { padding: 16px; }
.home-ai .hero .signal-grid strong { font-size: 22px; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
  .wf-pain-grid,
  .wf-beyond-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-cap-grid,
  .wf-stage-grid,
  .wf-why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wf-step:not(:last-child)::after { display: none; }
  .wf-arch,
  .wf-two-col,
  .wf-cta { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .wf-pain-grid,
  .wf-cap-grid,
  .wf-stage-grid,
  .wf-beyond-grid,
  .wf-why-grid,
  .wf-metric-row,
  .wf-flow { grid-template-columns: minmax(0, 1fr); }
  .home-ai .hero .signal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 主标题在窄屏下降字号：全站默认最小 40px，十个汉字会多出一行孤字 */
  .home-ai .hero-title { font-size: clamp(30px, 8.4vw, 40px); max-width: none; }
  .wf-layer { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wf-layer p { padding-left: 0; border-left: none; }
  .wf-cta { padding: 24px; }
  .wf-table th,
  .wf-table td { padding: 11px 10px; font-size: 13px; }
}
