/* QuickShot 首屏：拉出选区 → 尺寸读数 → 工具栏 → 标注箭头与序号。
   颜色取自 QuickShot 视觉规范：CYAN 选区与读数、SIGNAL_RED 标注、KEY 深色控件底。
   页面静态状态就是最终画面；hero.js 给 figure 加 data-stage 从头播放一次。 */

.qs-screen {
  --qs-cyan: #00a3e0;
  --qs-red: #f04438;
  --qs-key: #1c1d21;
  --qs-paper: #f6f6f3;
  height: 340px;
}

.qs-window {
  position: absolute;
  left: 50%;
  top: 30px;
  width: min(640px, 88%);
  transform: translateX(-50%);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.qs-titlebar {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.qs-titlebar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line-strong);
}
.qs-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  padding: 22px 26px 30px;
}
.qs-text {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-top: 6px;
}
.qs-text span {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: var(--sky);
}
.qs-text span:first-child {
  height: 14px;
  margin-bottom: 6px;
  background: var(--sky-deep);
}

/* 被截的图表卡片：固定 280×172，箭头坐标按它画 */
.qs-card {
  position: relative;
  width: 280px;
  height: 172px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}
.qs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.qs-card-head strong {
  color: var(--ink);
  font-size: 15px;
}
.qs-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
}
.qs-bars i {
  display: block;
  height: var(--h);
  border-radius: 3px 3px 1px 1px;
  background: var(--sky-deep);
}
.qs-bars i.is-peak {
  background: color-mix(in srgb, var(--accent) 55%, var(--sky-deep));
}

/* 选区：外面用大范围阴影压暗，像截图遮罩 */
.qs-sel {
  position: absolute;
  left: -6px;
  top: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: 1px solid var(--qs-cyan);
  box-shadow: 0 0 0 200vmax rgba(12, 16, 22, 0.34);
  z-index: 2;
}
.qs-size {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 6px);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--qs-cyan);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.qs-h {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fff;
  border: 1px solid var(--qs-cyan);
}
.qs-h-tl {
  left: -4px;
  top: -4px;
}
.qs-h-tr {
  right: -4px;
  top: -4px;
}
.qs-h-bl {
  left: -4px;
  bottom: -4px;
}
.qs-h-br {
  right: -4px;
  bottom: -4px;
}

/* 拖动时的十字光标，跟着右下角 */
.qs-cursor {
  position: absolute;
  right: -11px;
  bottom: -11px;
  width: 21px;
  height: 21px;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--qs-key), var(--qs-key)) center / 1.5px 100% no-repeat,
    linear-gradient(var(--qs-key), var(--qs-key)) center / 100% 1.5px no-repeat;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff);
}

.qs-arrow {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 280px;
  height: 172px;
  overflow: visible;
  pointer-events: none;
}
.qs-arrow path {
  fill: none;
  stroke: var(--qs-red);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qs-marker {
  position: absolute;
  left: 18px;
  bottom: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--qs-red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.qs-toolbar {
  position: absolute;
  right: -1px;
  top: calc(100% + 8px);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 9px;
  background: var(--qs-key);
  color: var(--qs-paper);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.45);
  transform-origin: 100% 0;
}
.qs-toolbar span {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.qs-toolbar span.is-on {
  background: var(--qs-cyan);
  color: #fff;
}
.qs-toolbar svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qs-toolbar svg .fill {
  fill: currentColor;
  stroke: none;
}
.qs-toolbar em {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: rgba(246, 246, 243, 0.22);
}

/* ---------- 播放：data-stage 0 起点 → 1 拉选区 → 2 工具栏 → 3 标注 ---------- */

.qs-screen[data-stage] .qs-sel {
  transition:
    width 900ms cubic-bezier(0.22, 0.8, 0.3, 1),
    height 900ms cubic-bezier(0.22, 0.8, 0.3, 1);
}
.qs-screen[data-stage="0"] .qs-sel {
  width: 0;
  height: 0;
  transition: none;
}
.qs-screen[data-stage="0"] .qs-sel > :not(.qs-cursor, .qs-h-tl, .qs-size),
.qs-screen[data-stage="1"] .qs-sel > :is(.qs-toolbar, .qs-arrow, .qs-marker) {
  opacity: 0;
}
.qs-screen[data-stage="0"] .qs-cursor,
.qs-screen[data-stage="1"] .qs-cursor {
  opacity: 1;
}
.qs-screen[data-stage] .qs-toolbar {
  transition:
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.3, 1.3, 0.5, 1);
}
.qs-screen[data-stage="1"] .qs-toolbar,
.qs-screen[data-stage="0"] .qs-toolbar {
  transform: scale(0.94) translateY(-4px);
}
.qs-screen[data-stage="2"] .qs-arrow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.qs-screen[data-stage="2"] .qs-arrow-head,
.qs-screen[data-stage="2"] .qs-marker {
  opacity: 0;
  transform: scale(0.6);
}
.qs-screen[data-stage="3"] .qs-arrow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 520ms cubic-bezier(0.4, 0, 0.2, 1);
}
.qs-screen[data-stage] .qs-arrow-head {
  transform-box: fill-box;
  transform-origin: 100% 0;
}
.qs-screen[data-stage="3"] .qs-arrow-head {
  transition:
    opacity 120ms ease 460ms,
    transform 220ms cubic-bezier(0.3, 1.5, 0.5, 1) 460ms;
}
.qs-screen[data-stage="3"] .qs-marker {
  transition:
    opacity 140ms ease 640ms,
    transform 260ms cubic-bezier(0.3, 1.6, 0.5, 1) 640ms;
}

@media (max-width: 760px) {
  .qs-screen {
    height: 320px;
  }
  .qs-window {
    width: calc(100% - 28px);
  }
  .qs-body {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 30px 12px 64px;
  }
  .qs-text {
    display: none;
  }
}

:root[data-theme="dark"] .qs-titlebar i {
  background: var(--line-strong);
}
:root[data-theme="dark"] .qs-sel {
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.58);
}

/* 功能区：实测速度（数据来自 QuickShot README 的性能表） */
.qs-bench {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 20px 48px;
  padding: 28px 0 32px;
  margin-bottom: 56px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.qs-bench-head h3 {
  margin-bottom: 4px;
}
.qs-bench-table {
  width: 100%;
  border-collapse: collapse;
}
.qs-bench-table th,
.qs-bench-table td {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  vertical-align: baseline;
}
.qs-bench-table tr:first-child > * {
  border-top: 0;
  padding-top: 0;
}
.qs-bench-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding-right: 16px;
}
.qs-bench-table td {
  text-align: right;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .qs-bench {
    grid-template-columns: 1fr;
  }
  .qs-bench-table td {
    font-size: 1.2rem;
  }
}
