// Shared inline SVGs and helpers for all sections

// SVG icon: speaker / audio
const IconSpeaker = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}>
    <rect x="2" y="6" width="7" height="12" rx="1"/>
    <path d="M9 8.5 L17 4 L17 20 L9 15.5"/>
    <path d="M20 9 Q22 12 20 15" opacity=".6"/>
  </svg>
);

const IconTV = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}>
    <rect x="2" y="3" width="20" height="15" rx="2"/>
    <path d="M7 21 L17 21"/>
    <path d="M8 21 L12 18 L16 21"/>
  </svg>
);

const IconWifi = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" {...p}>
    <path d="M5 12.5 Q12 7.5 19 12.5" opacity=".5"/>
    <path d="M8.5 15.5 Q12 12.5 15.5 15.5" opacity=".7"/>
    <circle cx="12" cy="18.5" r="1.4" fill={color} stroke="none"/>
  </svg>
);

const IconSync = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}>
    <polyline points="1,4 1,10 7,10"/>
    <polyline points="23,20 23,14 17,14"/>
    <path d="M21 8Q17.5 4 12 4 7.5 4 4 7" opacity=".6"/>
    <path d="M3 16Q6.5 20 12 20 16.5 20 20 17" opacity=".6"/>
  </svg>
);

const IconChip = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}>
    <rect x="4" y="4" width="16" height="16" rx="3"/>
    <rect x="9" y="9" width="6" height="6" rx="1"/>
    <path d="M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3"/>
  </svg>
);

const IconHotspot = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" {...p}>
    <circle cx="12" cy="12" r="3"/>
    <path d="M12 4Q8 4 7 8" opacity=".4"/>
    <path d="M12 4Q16 4 17 8" opacity=".4"/>
    <path d="M6 10Q4 12 6 14" opacity=".35"/>
    <path d="M18 10Q20 12 18 14" opacity=".35"/>
  </svg>
);

const IconAlert = ({size=16,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}>
    <path d="M12 2L2 22h20L12 2z"/>
    <line x1="12" y1="10" x2="12" y2="15"/>
    <circle cx="12" cy="18.5" r=".6" fill={color} stroke="none"/>
  </svg>
);

const IconClock = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}>
    <circle cx="12" cy="12" r="10"/>
    <polyline points="12 6 12 12 16 14"/>
  </svg>
);

const IconSignal = ({size=18,color='currentColor',...p}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="1.8" strokeLinecap="round" {...p}>
    <rect x="3" y="12" width="4" height="8" rx="1"/>
    <rect x="10" y="7" width="4" height="13" rx="1"/>
    <rect x="17" y="2" width="4" height="18" rx="1"/>
  </svg>
);

const DocFigure = ({ src, alt, caption }) => (
  <figure className="doc-figure reveal">
    <div className="figure-frame">
      <img src={src} alt={alt} loading="lazy" />
    </div>
    <figcaption className="fig-cap">
      <span>{caption}</span>
      <a href={src} target="_blank" rel="noopener">查看原图</a>
    </figcaption>
  </figure>
);

// Export all
Object.assign(window, {
  IconSpeaker, IconTV, IconWifi, IconSync, IconChip,
  IconHotspot, IconAlert, IconClock, IconSignal, DocFigure
});