/* 示范页 · 短循环 CSS 动画（约 7–10 秒/节） */

.demo-anim {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(145deg, #fafafa 0%, #fff 55%, var(--accent-soft, #fff4e8) 100%);
  border: 1px solid var(--border, #ebebeb);
}

.demo-anim-meta {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--muted, #8c8c8c);
  text-align: center;
}

.demo-anim-stage {
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.demo-anim-stage--split {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  min-height: 220px;
}

.demo-anim-captions {
  position: relative;
  height: 2.5rem;
  margin-top: 0.75rem;
  text-align: center;
}

.demo-anim-cap {
  position: absolute;
  left: 0;
  right: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text, #1a1a1a);
  opacity: 0;
  transform: translateY(6px);
  animation: demo-cap-cycle 9s ease-in-out infinite;
}

.demo-anim-cap-1 { animation-delay: 0s; }
.demo-anim-cap-2 { animation-delay: 3s; }
.demo-anim-cap-3 { animation-delay: 6s; }

@keyframes demo-cap-cycle {
  0%, 8% { opacity: 0; transform: translateY(6px); }
  12%, 30% { opacity: 1; transform: translateY(0); }
  34%, 100% { opacity: 0; transform: translateY(-4px); }
}

/* —— 手机蓝牙 —— */
.demo-anim-phone {
  width: 132px;
  background: #1a1a1a;
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 2;
}

.demo-anim-phone-notch {
  width: 48px;
  height: 5px;
  background: #333;
  border-radius: 99px;
  margin: 0 auto 4px;
}

.demo-anim-phone-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.5625rem;
  color: #ccc;
  padding: 0 4px 4px;
}

.demo-anim-phone-bt-icon {
  font-size: 0.5rem;
  font-weight: 700;
  color: #4dabf7;
  animation: demo-bt-icon 9s ease-in-out infinite;
}

@keyframes demo-bt-icon {
  0%, 40% { opacity: 0.4; }
  50%, 75% { opacity: 1; color: #228be6; }
  85%, 100% { opacity: 0.4; }
}

.demo-anim-phone-body {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  position: relative;
  min-height: 140px;
}

.demo-anim-phone-title {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
}

.demo-anim-mini-slip {
  font-size: 0.5625rem;
  text-align: center;
  border: 1px dashed #ccc;
  padding: 6px 4px;
  margin-bottom: 8px;
  line-height: 1.35;
}

.demo-anim-phone-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-anim-btn {
  display: block;
  text-align: center;
  font-size: 0.5625rem;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--border, #ddd);
}

.demo-anim-btn-bt {
  background: var(--accent, #fa8919);
  color: #fff;
  border-color: var(--accent, #fa8919);
  animation: demo-bt-btn-pulse 9s ease-in-out infinite;
}

@keyframes demo-bt-btn-pulse {
  0%, 28% { box-shadow: none; transform: scale(1); }
  32%, 55% { box-shadow: 0 0 0 3px rgba(250, 137, 25, 0.45); transform: scale(1.03); }
  60%, 100% { box-shadow: none; transform: scale(1); }
}

.demo-anim-btn-ghost { background: #f5f5f5; color: #666; }

.demo-anim-finger {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  background: rgba(250, 137, 25, 0.35);
  border: 2px solid var(--accent, #fa8919);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}

.demo-anim-finger-bt {
  bottom: 18px;
  right: 20px;
  animation: demo-finger-bt 9s ease-in-out infinite;
}

@keyframes demo-finger-bt {
  0%, 25% { opacity: 0; transform: translate(20px, 20px) scale(0.8); }
  30%, 52% { opacity: 1; transform: translate(0, 0) scale(1); }
  58%, 100% { opacity: 0; transform: translate(0, 0) scale(0.9); }
}

.demo-anim-link-zone {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-anim-link-zone--short { width: 36px; height: 36px; }

.demo-anim-wave {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #4dabf7;
  border-radius: 50%;
  opacity: 0;
  animation: demo-bt-wave 9s ease-out infinite;
}

.demo-anim-wave-1 { animation-delay: 3.2s; }
.demo-anim-wave-2 { animation-delay: 3.5s; }
.demo-anim-wave-3 { animation-delay: 3.8s; }

@keyframes demo-bt-wave {
  0%, 38% { opacity: 0; transform: scale(0.3); }
  42%, 70% { opacity: 0.85; transform: scale(2.2); border-color: rgba(77, 171, 247, 0.2); }
  75%, 100% { opacity: 0; transform: scale(2.8); }
}

.demo-anim-printer {
  position: relative;
  z-index: 1;
}

.demo-anim-printer-body {
  width: 72px;
  height: 44px;
  background: linear-gradient(180deg, #444 0%, #222 100%);
  border-radius: 6px 6px 2px 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.demo-anim-printer--gap .demo-anim-printer-body {
  width: 64px;
  height: 38px;
}

.demo-anim-paper {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(0);
  width: 52px;
  min-height: 0;
  background: #fff;
  border: 1px solid #ddd;
  font-size: 0.5rem;
  text-align: center;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  animation: demo-paper-out 9s ease-in-out infinite;
}

.demo-anim-paper-gap { width: 44px; font-size: 0.4375rem; }

@keyframes demo-paper-out {
  0%, 58% { opacity: 0; min-height: 0; padding: 0; transform: translateX(-50%) translateY(0); }
  65% { opacity: 1; min-height: 28px; padding: 4px 2px; transform: translateX(-50%) translateY(4px); }
  78%, 92% { opacity: 1; min-height: 48px; padding: 6px 2px; transform: translateX(-50%) translateY(12px); }
  100% { opacity: 0; min-height: 48px; transform: translateX(-50%) translateY(16px); }
}

/* —— 模版选择 —— */
.demo-anim--tpl .demo-anim-cap { animation-duration: 8s; }
.demo-anim--tpl .demo-anim-cap-2 { animation-delay: 2.7s; }
.demo-anim--tpl .demo-anim-cap-3 { animation-delay: 5.4s; }

.demo-anim-tpl-toolbar { width: 100%; max-width: 320px; }
.demo-anim-search {
  display: block;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #666;
}

.demo-anim-tpl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  width: 100%;
  max-width: 320px;
}

.demo-anim-tpl-card {
  font-size: 0.625rem;
  padding: 0.4rem 0.3rem;
  text-align: center;
  border: 2px solid var(--border-strong, #d9d9d9);
  border-radius: 8px;
  background: #fff;
  transition: none;
}

.demo-anim-tpl-card-on {
  border-color: var(--accent, #fa8919);
  background: var(--accent-soft, #fff4e8);
  box-shadow: 0 0 0 2px rgba(250, 137, 25, 0.25);
  animation: demo-tpl-select 8s ease-in-out infinite;
}

@keyframes demo-tpl-select {
  0%, 15% { border-color: var(--border-strong); background: #fff; box-shadow: none; }
  20%, 75% { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(250, 137, 25, 0.25); }
  82%, 100% { border-color: var(--border-strong); background: #fff; box-shadow: none; }
}

.demo-anim-tpl-form {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  opacity: 0.5;
  animation: demo-tpl-form 8s ease-in-out infinite;
}

@keyframes demo-tpl-form {
  0%, 22% { opacity: 0.45; }
  28%, 80% { opacity: 1; }
  88%, 100% { opacity: 0.45; }
}

.demo-anim-tpl-field {
  margin: 0.25rem 0;
  font-size: 0.6875rem;
  display: flex;
  gap: 0.5rem;
}

.demo-anim-tpl-field span { color: var(--muted); min-width: 2.5em; }
.demo-anim-tpl-val { font-style: normal; font-weight: 600; color: var(--text); }
.demo-anim-tpl-price { color: var(--accent-dark, #d96b00); font-size: 0.8125rem; }

.demo-anim-finger-tpl {
  top: 42%;
  left: 38%;
  animation: demo-finger-tpl 8s ease-in-out infinite;
}

@keyframes demo-finger-tpl {
  0%, 12% { opacity: 0; transform: translate(10px, -10px); }
  16%, 28% { opacity: 1; transform: translate(0, 0); }
  32%, 100% { opacity: 0; }
}

/* —— 间隙吊牌 —— */
.demo-anim--gap .demo-anim-cap { animation-duration: 8s; }
.demo-anim--gap .demo-anim-cap-2 { animation-delay: 2.7s; }
.demo-anim--gap .demo-anim-cap-3 { animation-delay: 5.4s; }
.demo-anim--gap .demo-anim-wave { animation-duration: 8s; }
.demo-anim--gap .demo-anim-paper { animation-duration: 8s; }

.demo-anim-gap-tag {
  width: 42px;
  min-height: 56px;
  padding: 4px 3px;
  border: 1px dashed #999;
  font-size: 0.5625rem;
  text-align: center;
  line-height: 1.3;
  background: #fff;
}

.demo-anim-gap-size {
  margin: 0.25rem 0 0;
  font-size: 0.625rem;
  color: var(--muted);
  text-align: center;
}

/* —— CSV 导出 —— */
.demo-anim--csv .demo-anim-cap { animation-duration: 7s; }
.demo-anim--csv .demo-anim-cap-2 { animation-delay: 2.3s; }
.demo-anim--csv .demo-anim-cap-3 { animation-delay: 4.6s; }

.demo-anim-stage--csv {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.demo-anim-dash {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  min-width: 200px;
}

.demo-anim-dash-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.demo-anim-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.demo-anim-export-btn {
  font-size: 0.5625rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fafafa;
}

.demo-anim-export-btn-on {
  background: var(--accent, #fa8919);
  color: #fff;
  border-color: var(--accent);
  animation: demo-export-pulse 7s ease-in-out infinite;
}

@keyframes demo-export-pulse {
  0%, 18% { box-shadow: none; }
  22%, 55% { box-shadow: 0 0 0 3px rgba(250, 137, 25, 0.4); }
  60%, 100% { box-shadow: none; }
}

.demo-anim-finger-csv {
  bottom: 8px;
  right: 24px;
  animation: demo-finger-csv 7s ease-in-out infinite;
}

@keyframes demo-finger-csv {
  0%, 15% { opacity: 0; }
  20%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.demo-anim-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(8px);
  animation: demo-file-drop 7s ease-in-out infinite;
}

@keyframes demo-file-drop {
  0%, 48% { opacity: 0; transform: translateY(10px); }
  55%, 88% { opacity: 1; transform: translateY(0); }
  95%, 100% { opacity: 0; transform: translateY(-4px); }
}

.demo-anim-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 48px;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 700;
  color: #389e0d;
}

.demo-anim-file-name {
  font-size: 0.625rem;
  color: var(--muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 备忘 —— */
.demo-anim--memo .demo-anim-cap { animation-duration: 8s; }
.demo-anim--memo .demo-anim-cap-2 { animation-delay: 2.7s; }
.demo-anim--memo .demo-anim-cap-3 { animation-delay: 5.4s; }

.demo-anim-memo-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.demo-anim-memo-step {
  font-size: 0.6875rem;
  padding: 0.3rem 0.5rem;
  border-radius: 99px;
  background: #f5f5f5;
  border: 1px solid var(--border);
  opacity: 0.45;
}

.demo-anim-memo-step-1 { animation: demo-memo-step 8s ease-in-out infinite; animation-delay: 0s; }
.demo-anim-memo-step-2 { animation: demo-memo-step 8s ease-in-out infinite; animation-delay: 2.7s; }
.demo-anim-memo-step-3 { animation: demo-memo-step 8s ease-in-out infinite; animation-delay: 5.4s; }

@keyframes demo-memo-step {
  0%, 8% { opacity: 0.4; background: #f5f5f5; border-color: var(--border); }
  12%, 30% { opacity: 1; background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
  34%, 100% { opacity: 0.4; background: #f5f5f5; border-color: var(--border); }
}

.demo-anim-memo-arrow { font-size: 0.75rem; color: var(--muted); }

.demo-anim-memo-slip {
  opacity: 0;
  animation: demo-memo-slip 8s ease-in-out infinite;
  animation-delay: 5s;
}

@keyframes demo-memo-slip {
  0%, 58% { opacity: 0; transform: scale(0.92); }
  65%, 90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}

/* —— 场景区块 —— */
.demo-scenario {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 5rem;
}

.demo-scenario--highlight {
  background: linear-gradient(180deg, var(--accent-soft, #fff4e8) 0%, transparent 280px);
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-top-color: var(--accent);
}

.demo-scenario-head { margin-bottom: 1rem; }

.demo-scenario-eyebrow {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark, #d96b00);
  margin: 0 0 0.35rem;
}

.demo-scenario-eyebrow--hot {
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

.demo-scenario h2 { margin: 0 0 0.5rem; font-size: 1.375rem; }
.demo-scenario-lead { margin: 0 0 1rem; max-width: 44em; line-height: 1.6; color: #434343; }

.demo-scenario-tips {
  margin: 1rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle, #f7f7f8);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.8125rem;
}

.demo-scenario-tips ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.demo-scenario-tips li { margin: 0.2rem 0; }

.demo-scenario-steps { display: grid; gap: 1.5rem; margin-top: 1.25rem; }

.demo-scenario-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
}

.demo-scenario-nav a {
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: #fff;
}

.demo-scenario-nav a:hover,
.demo-scenario-nav a.is-hot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.guide-anim-wrap { margin: 1rem 0; }

@media (prefers-reduced-motion: reduce) {
  .demo-anim-cap,
  .demo-anim-finger,
  .demo-anim-wave,
  .demo-anim-paper,
  .demo-anim-btn-bt,
  .demo-anim-tpl-card-on,
  .demo-anim-tpl-form,
  .demo-anim-export-btn-on,
  .demo-anim-file,
  .demo-anim-memo-step,
  .demo-anim-memo-slip,
  .demo-anim-phone-bt-icon {
    animation: none !important;
  }
  .demo-anim-cap-1,
  .demo-anim-memo-step-1 { opacity: 1; transform: none; position: static; height: auto; }
  .demo-anim-cap-2,
  .demo-anim-cap-3,
  .demo-anim-finger { display: none; }
  .demo-anim-captions { height: auto; }
  .demo-anim-tpl-card-on,
  .demo-anim-export-btn-on { border-color: var(--accent); background: var(--accent-soft); }
  .demo-anim-paper { opacity: 1; min-height: 40px; padding: 4px; position: relative; left: auto; transform: none; margin-top: 4px; }
  .demo-anim-file { opacity: 1; transform: none; }
  .demo-anim-memo-slip { opacity: 1; }
}

@media (max-width: 520px) {
  .demo-anim-tpl-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-anim-stage--split { flex-direction: column; align-items: center; }
}

.demo-anim-btn-share {
  background: linear-gradient(135deg, #ff2442, #ff6b35);
  color: #fff;
  font-size: 0.65rem;
}

.demo-mock-share-panel {
  margin: 0.75rem 0;
  padding: 0.65rem;
}
.demo-mock-share-panel h2 {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}
.demo-mock-share-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.demo-mock-share-picker .btn-sm {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
}
.demo-mock-share-stage {
  padding: 0.5rem;
  min-height: 3rem;
  background: #e8e8ec;
  border-radius: 8px;
}
.demo-mock-share-hint {
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
}
