// Lucide-style line icons drawn inline so we never pull a runtime icon lib.
// Stroke 1.75, currentColor, 24x24 viewBox by default.
const Icon = ({ d, size = 20, className = '', stroke = 1.75, children, ...rest }) => (
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width={size}
    height={size}
    viewBox="0 0 24 24"
    fill="none"
    stroke="currentColor"
    strokeWidth={stroke}
    strokeLinecap="round"
    strokeLinejoin="round"
    className={className}
    {...rest}
  >
    {children}
  </svg>
);

const I = {
  Logo: ({ size = 28 }) => (
    // Brushstroke + magnifier — "墨鉴" mark
    <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
      <rect x="1.5" y="1.5" width="29" height="29" rx="7" fill="#0F1E3D" />
      <path d="M9 9c2.6.2 5.2 1.4 7 3.4 1.7 2 2.7 4.7 2.7 7.4" stroke="#3B82F6" strokeWidth="1.8" strokeLinecap="round" fill="none" />
      <path d="M8 19c1.8-1 3.6-1.6 5.4-1.7" stroke="#E2E8F0" strokeWidth="1.6" strokeLinecap="round" fill="none" />
      <circle cx="21.5" cy="21.5" r="3.6" stroke="#E2E8F0" strokeWidth="1.8" fill="none" />
      <path d="M24.2 24.2L26 26" stroke="#E2E8F0" strokeWidth="1.8" strokeLinecap="round" />
    </svg>
  ),
  Search: (p) => <Icon {...p}><circle cx="11" cy="11" r="7" /><path d="M20 20l-3.5-3.5" /></Icon>,
  Upload: (p) => <Icon {...p}><path d="M12 16V4" /><path d="M7 9l5-5 5 5" /><path d="M5 20h14" /></Icon>,
  Download: (p) => <Icon {...p}><path d="M12 4v12" /><path d="M7 11l5 5 5-5" /><path d="M5 20h14" /></Icon>,
  File: (p) => <Icon {...p}><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" /><path d="M14 3v5h5" /></Icon>,
  FileText: (p) => <Icon {...p}><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" /><path d="M14 3v5h5" /><path d="M8 13h8" /><path d="M8 17h6" /></Icon>,
  Check: (p) => <Icon {...p}><path d="M4 12l5 5L20 6" /></Icon>,
  CheckCircle: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><path d="M8 12l3 3 5-6" /></Icon>,
  AlertTriangle: (p) => <Icon {...p}><path d="M12 3l10 18H2L12 3z" /><path d="M12 10v5" /><circle cx="12" cy="18" r=".5" fill="currentColor" /></Icon>,
  AlertCircle: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><path d="M12 8v5" /><circle cx="12" cy="16" r=".5" fill="currentColor" /></Icon>,
  Info: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><path d="M12 11v5" /><circle cx="12" cy="8" r=".5" fill="currentColor" /></Icon>,
  Shield: (p) => <Icon {...p}><path d="M12 3l8 3v6c0 5-3.5 8.5-8 9-4.5-.5-8-4-8-9V6l8-3z" /></Icon>,
  ShieldCheck: (p) => <Icon {...p}><path d="M12 3l8 3v6c0 5-3.5 8.5-8 9-4.5-.5-8-4-8-9V6l8-3z" /><path d="M9 12l2 2 4-4" /></Icon>,
  Lock: (p) => <Icon {...p}><rect x="5" y="11" width="14" height="9" rx="2" /><path d="M8 11V8a4 4 0 0 1 8 0v3" /></Icon>,
  Clock: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><path d="M12 7v5l3 2" /></Icon>,
  Sparkles: (p) => <Icon {...p}><path d="M12 3l1.6 4.4L18 9l-4.4 1.6L12 15l-1.6-4.4L6 9l4.4-1.6L12 3z" /><path d="M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8L19 15z" /></Icon>,
  Brain: (p) => <Icon {...p}><path d="M12 5a3 3 0 0 0-3 3v.5A3 3 0 0 0 7 14a3 3 0 0 0 2 2.8V18a2 2 0 0 0 3 0v-2" /><path d="M12 5a3 3 0 0 1 3 3v.5A3 3 0 0 1 17 14a3 3 0 0 1-2 2.8V18a2 2 0 0 1-3 0" /></Icon>,
  Activity: (p) => <Icon {...p}><path d="M3 12h4l3-8 4 16 3-8h4" /></Icon>,
  Layers: (p) => <Icon {...p}><path d="M12 3l9 5-9 5-9-5 9-5z" /><path d="M3 13l9 5 9-5" /><path d="M3 17l9 5 9-5" /></Icon>,
  BarChart: (p) => <Icon {...p}><path d="M4 20V10" /><path d="M10 20V4" /><path d="M16 20v-8" /><path d="M22 20H2" /></Icon>,
  Radar: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><circle cx="12" cy="12" r="5.5" /><circle cx="12" cy="12" r="2" /><path d="M12 3v9l6 3" /></Icon>,
  Target: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><circle cx="12" cy="12" r="5" /><circle cx="12" cy="12" r="1.5" fill="currentColor" /></Icon>,
  Cpu: (p) => <Icon {...p}><rect x="5" y="5" width="14" height="14" rx="2" /><rect x="9" y="9" width="6" height="6" /><path d="M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3" /></Icon>,
  Chevron: (p) => <Icon {...p}><path d="M9 6l6 6-6 6" /></Icon>,
  ChevronDown: (p) => <Icon {...p}><path d="M6 9l6 6 6-6" /></Icon>,
  ArrowRight: (p) => <Icon {...p}><path d="M5 12h14" /><path d="M13 5l7 7-7 7" /></Icon>,
  ArrowUpRight: (p) => <Icon {...p}><path d="M7 17L17 7" /><path d="M8 7h9v9" /></Icon>,
  X: (p) => <Icon {...p}><path d="M6 6l12 12M18 6L6 18" /></Icon>,
  Plus: (p) => <Icon {...p}><path d="M12 5v14M5 12h14" /></Icon>,
  Menu: (p) => <Icon {...p}><path d="M4 7h16M4 12h16M4 17h16" /></Icon>,
  Quote: (p) => <Icon {...p}><path d="M7 7h4v4H7c0 3 1 4 3 5" /><path d="M15 7h4v4h-4c0 3 1 4 3 5" /></Icon>,
  Refresh: (p) => <Icon {...p}><path d="M21 12a9 9 0 0 1-15.5 6.3L3 16" /><path d="M3 12a9 9 0 0 1 15.5-6.3L21 8" /><path d="M21 3v5h-5" /><path d="M3 21v-5h5" /></Icon>,
  Wallet: (p) => <Icon {...p}><rect x="3" y="6" width="18" height="13" rx="2" /><path d="M3 10h18" /><circle cx="16" cy="14" r="1" fill="currentColor" /></Icon>,
  QrCode: (p) => <Icon {...p}><rect x="4" y="4" width="6" height="6" /><rect x="14" y="4" width="6" height="6" /><rect x="4" y="14" width="6" height="6" /><path d="M14 14h2v2h-2zM18 14h2v2h-2zM14 18h2v2h-2zM18 18h2v2h-2z" /></Icon>,
  Eye: (p) => <Icon {...p}><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z" /><circle cx="12" cy="12" r="3" /></Icon>,
  Edit: (p) => <Icon {...p}><path d="M14 4l6 6L8 22H2v-6L14 4z" /></Icon>,
  Trash: (p) => <Icon {...p}><path d="M4 7h16" /><path d="M9 7V4h6v3" /><path d="M6 7l1 13h10l1-13" /></Icon>,
  Filter: (p) => <Icon {...p}><path d="M3 5h18l-7 9v6l-4-2v-4L3 5z" /></Icon>,
  MessageSquare: (p) => <Icon {...p}><path d="M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2z" /></Icon>,
  Code: (p) => <Icon {...p}><path d="M9 18l-6-6 6-6" /><path d="M15 6l6 6-6 6" /></Icon>,
  UserCheck: (p) => <Icon {...p}><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /><circle cx="9" cy="7" r="4" /><path d="M16 11l2 2 4-4" /></Icon>,
  Beaker: (p) => <Icon {...p}><path d="M9 3h6v5l5 11a2 2 0 0 1-2 3H6a2 2 0 0 1-2-3l5-11V3z" /><path d="M9 3h6" /></Icon>,
  Microscope: (p) => <Icon {...p}><path d="M6 18h12" /><path d="M9 12V6a3 3 0 0 1 6 0v6" /><circle cx="12" cy="15" r="3" /></Icon>,
  Mail: (p) => <Icon {...p}><rect x="3" y="5" width="18" height="14" rx="2" /><path d="M3 7l9 6 9-6" /></Icon>,
  MessageSquare: (p) => <Icon {...p}><path d="M21 15a2 2 0 0 1-2 2H8l-4 4V6a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v9z" /></Icon>,
  Code: (p) => <Icon {...p}><path d="M9 8l-5 4 5 4" /><path d="M15 8l5 4-5 4" /><path d="M13 6l-2 12" /></Icon>,
  UserCheck: (p) => <Icon {...p}><circle cx="9" cy="8" r="4" /><path d="M2 21c0-4 3.5-7 7-7s7 3 7 7" /><path d="M17 11l2 2 4-4" /></Icon>,
  Sliders: (p) => <Icon {...p}><path d="M4 21V14M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3" /><circle cx="4" cy="12" r="2" /><circle cx="12" cy="10" r="2" /><circle cx="20" cy="14" r="2" /></Icon>,
  Globe: (p) => <Icon {...p}><circle cx="12" cy="12" r="9" /><path d="M3 12h18" /><path d="M12 3a13 13 0 0 1 0 18M12 3a13 13 0 0 0 0 18" /></Icon>,
  Book: (p) => <Icon {...p}><path d="M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3V4z" /><path d="M5 17a3 3 0 0 1 3-3h11" /></Icon>,
  University: (p) => <Icon {...p}><path d="M3 9l9-5 9 5-9 5-9-5z" /><path d="M5 10v6M9 11v5M13 11v5M17 11v5M21 10v6" /></Icon>,
  Spinner: ({ size = 16, className = '' }) => (
    <svg width={size} height={size} viewBox="0 0 24 24" className={className} style={{ animation: 'spin .9s linear infinite' }}>
      <style>{`@keyframes spin { to { transform: rotate(360deg); } }`}</style>
      <circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth="2.5" strokeOpacity=".18" fill="none" />
      <path d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" fill="none" />
    </svg>
  ),
  Dot: ({ className = '' }) => <span className={`inline-block w-1.5 h-1.5 rounded-full ${className}`} />,
};

window.I = I;
window.Icon = Icon;
