/* ==========================================================================
 * 马上默 · 悬浮工作流 Dock (sm-dock)
 * 只作用于 study 布局顶部，毛玻璃吸顶 + 流程动效，明暗同源
 * ========================================================================== */

html[data-study-v3] .sm-dock {
  position: sticky;
  top: 0;
  z-index: 60;
  margin: 10px auto 0;
  width: min(1180px, calc(100% - 48px));
  border: 1px solid var(--sn-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--sn-surface) 86%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 34px rgba(31, 45, 48, .09), 0 2px 8px rgba(31, 45, 48, .05);
  animation: smDockGlow 6s ease-in-out infinite;
  transition: box-shadow .25s ease;
}
html[data-study-v3] .sm-dock:hover { box-shadow: 0 16px 44px rgba(31, 45, 48, .14); }
@keyframes smDockGlow {
  0%, 100% { box-shadow: 0 10px 34px rgba(31, 45, 48, .09), 0 2px 8px rgba(31, 45, 48, .05); }
  50% { box-shadow: 0 14px 42px rgba(31, 45, 48, .15), 0 2px 10px rgba(31, 45, 48, .07); }
}

html[data-study-v3] .sm-dock__inner {
  display: flex;
  align-items: center;
  gap: 18px 24px;
  padding: 11px 16px;
}

/* 品牌 */
html[data-study-v3] .sm-dock__brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
html[data-study-v3] .sm-dock__logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--sn-font-serif); font-weight: 900; font-size: 18px;
  color: #fff; background: linear-gradient(135deg, var(--sn-brand), var(--sn-brand-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
html[data-study-v3] .sm-dock__brand-text { display: flex; flex-direction: column; line-height: 1.25; }
html[data-study-v3] .sm-dock__brand-text b { font-family: var(--sn-font-serif); font-size: 1rem; color: var(--sn-ink); }
html[data-study-v3] .sm-dock__brand-text small { font-size: .68rem; color: var(--sn-muted); }

/* 流程 */
html[data-study-v3] .sm-flow { display: flex; align-items: center; gap: 0; flex: 1 1 auto; min-width: 0; }
html[data-study-v3] .sm-flow__step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px; border: 0; border-radius: 12px; background: transparent;
  color: var(--sn-muted); font-family: inherit; font-size: .84rem; font-weight: 600;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
html[data-study-v3] .sm-flow__step:hover { color: var(--sn-ink); background: var(--sn-brand-soft); transform: translateY(-1px); }
/* 当前步骤：不用实心块，用底部细线 + 品牌色文字，克制精致 */
html[data-study-v3] .sm-flow__step.is-active,
html[data-study-v3] .sm-flow__step.active {
  position: relative;
  color: var(--sn-brand);
  background: var(--sn-brand-soft);
  font-weight: 800;
}
html[data-study-v3] .sm-flow__step.is-active::after,
html[data-study-v3] .sm-flow__step.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  border-radius: 99px;
  background: var(--sn-brand);
}
html[data-study-v3][data-theme="dark"] .sm-flow__step.is-active,
html[data-study-v3][data-theme="dark"] .sm-flow__step.active {
  color: var(--sn-brand-2);
  background: var(--sn-brand-soft);
}
html[data-study-v3][data-theme="dark"] .sm-flow__step.is-active::after,
html[data-study-v3][data-theme="dark"] .sm-flow__step.active::after { background: var(--sn-brand-2); }
html[data-study-v3] .sm-flow__dot {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--sn-line-strong); background: var(--sn-surface);
  font-size: .72rem; font-weight: 800; color: var(--sn-muted);
  transition: all .2s ease;
}
html[data-study-v3] .sm-flow__step.is-active .sm-flow__dot,
html[data-study-v3] .sm-flow__step.active .sm-flow__dot {
  color: #fff; border-color: var(--sn-brand); background: var(--sn-brand);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--sn-brand) 55%, transparent);
  animation: smPulse 2.4s ease-out infinite;
}
@keyframes smPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sn-brand) 55%, transparent); }
  70% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--sn-brand) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sn-brand) 0%, transparent); }
}
html[data-study-v3][data-theme="dark"] .sm-flow__step.is-active .sm-flow__dot,
html[data-study-v3][data-theme="dark"] .sm-flow__step.active .sm-flow__dot { color: #102022; border-color: var(--sn-brand-2); background: var(--sn-brand-2); }

/* 步骤间流动连接线 */
html[data-study-v3] .sm-flow__link {
  position: relative; flex: 1 1 22px; min-width: 14px; height: 2px; margin: 0 6px;
  border-radius: 99px; background: var(--sn-line-strong); overflow: hidden;
}
html[data-study-v3] .sm-flow__link::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 40%;
  border-radius: 99px; background: linear-gradient(90deg, transparent, var(--sn-brand), transparent);
  animation: smFlow 2.8s linear infinite;
}
@keyframes smFlow { from { transform: translateX(-120%); } to { transform: translateX(320%); } }

/* 动作区 */
html[data-study-v3] .sm-dock__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
html[data-study-v3] .sm-dock__status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--sn-brand-soft); color: var(--sn-brand);
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
html[data-study-v3] .sm-dock__status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--sn-success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--sn-success) 60%, transparent);
  animation: smPulseDot 2s ease-out infinite;
}
@keyframes smPulseDot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sn-success) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--sn-success) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sn-success) 0%, transparent); }
}
html[data-study-v3] .sm-dock__guide,
html[data-study-v3] .sm-dock__ai {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border: 1px solid var(--sn-line); border-radius: 10px;
  background: var(--sn-surface); color: var(--sn-ink-2);
  font-family: inherit; font-size: .76rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all .16s ease;
}
html[data-study-v3] .sm-dock__guide:hover,
html[data-study-v3] .sm-dock__ai:hover { border-color: var(--sn-brand); color: var(--sn-brand); transform: translateY(-1px); }
html[data-study-v3] .sm-dock__guide span {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid currentColor; font-size: .7rem;
}

/* 导出按钮：明面、醒目、带头像 */
html[data-study-v3] .sm-dock__export {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border: 0; border-radius: 11px;
  background: linear-gradient(135deg, var(--sn-gold), #cf913f); color: #fff;
  font-family: inherit; font-size: .8rem; font-weight: 800;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--sn-gold) 34%, transparent);
  transition: transform .16s ease, box-shadow .16s ease;
}
html[data-study-v3] .sm-dock__export span {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px;
  background: rgba(255,255,255,.22); font-size: .9rem;
}
html[data-study-v3] .sm-dock__export:hover { transform: translateY(-2px); box-shadow: 0 10px 22px color-mix(in srgb, var(--sn-gold) 46%, transparent); }

html[data-study-v3] .sm-dock__open {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: 11px;
  background: var(--sn-brand); color: #fff;
  font-size: .8rem; font-weight: 800; text-decoration: none; white-space: nowrap;
  transition: transform .16s ease, background .16s ease;
}
html[data-study-v3] .sm-dock__open:hover { transform: translateY(-2px); background: var(--sn-brand-2); }
html[data-study-v3][data-theme="dark"] .sm-dock__open { color: #102022; }

/* 响应式 */
@media (max-width: 1100px) {
  html[data-study-v3] .sm-dock__status { display: none; }
  html[data-study-v3] .sm-flow__label { font-size: .78rem; }
}
@media (max-width: 800px) {
  html[data-study-v3] .sm-dock { width: calc(100% - 24px); }
  html[data-study-v3] .sm-dock__inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 12px; }
  html[data-study-v3] .sm-dock__brand-text small { display: none; }
  html[data-study-v3] .sm-flow { order: 3; flex-basis: 100%; }
  html[data-study-v3] .sm-dock__actions { margin-left: auto; }
  html[data-study-v3] .sm-dock__guide, html[data-study-v3] .sm-dock__ai { font-size: 0; gap: 0; padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-study-v3] .sm-dock,
  html[data-study-v3] .sm-flow__step.is-active .sm-flow__dot,
  html[data-study-v3] .sm-flow__step.active .sm-flow__dot,
  html[data-study-v3] .sm-dock__status-dot,
  html[data-study-v3] .sm-flow__link::after { animation: none; }
}
