/* ========================================
   SVG图标样式库 - 统一优化的2D轮廓风格
   ======================================== */

/* ========================================
   基础图标样式
   ======================================== */
.svg-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
  /* 确保图标在flex布局中保持比例 */
}

/* ========================================
   图标尺寸变体
   ======================================== */
.svg-icon.xxs {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.svg-icon.xs {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.svg-icon.small {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.svg-icon.medium {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.svg-icon.large {
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
}

.svg-icon.xl {
  width: 64px;
  height: 64px;
  stroke-width: 1;
}

.svg-icon.xxl {
  width: 80px;
  height: 80px;
  stroke-width: 0.75;
}

/* 固定尺寸类（兼容现有代码） */
.svg-icon-24 {
  width: 24px;
  height: 24px;
}

.svg-icon-80 {
  width: 80px;
  height: 80px;
}

/* ========================================
   图标颜色变体
   ======================================== */
.svg-icon.primary,
.svg-icon.primary-color {
  color: #139389;
}

.svg-icon.secondary {
  color: #6366f1;
}

.svg-icon.success {
  color: #10b981;
}

.svg-icon.warning {
  color: #f59e0b;
}

.svg-icon.danger {
  color: #ef4444;
}

.svg-icon.muted {
  color: #6b7280;
}

.svg-icon.white,
.svg-icon.white-icon {
  color: #ffffff;
}

.svg-icon.black {
  color: #000000;
}

.svg-icon.gray-light {
  color: #d1d5db;
}

.svg-icon.gray-dark {
  color: #4b5563;
}

/* ========================================
   图标动画和交互
   ======================================== */
.svg-icon.animated {
  transition: all 0.3s ease;
}

.svg-icon.animated:hover {
  transform: scale(1.1);
  color: #139389;
}

.svg-icon.spin {
  animation: svg-icon-spin 2s linear infinite;
}

@keyframes svg-icon-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.svg-icon.pulse {
  animation: svg-icon-pulse 2s ease-in-out infinite;
}

@keyframes svg-icon-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ========================================
   上下文图标样式
   ======================================== */

/* 产品图标容器 */
.product-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 1rem;
  margin: 0 auto 1rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.product-icon:hover {
  border-color: #139389;
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2f1 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(19, 147, 137, 0.15);
}

.product-icon .svg-icon {
  width: 40px;
  height: 40px;
  color: #139389;
}

/* 卡片图标样式 */
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-icon .svg-icon {
  width: 48px;
  height: 48px;
  color: #139389;
}

.card:hover .card-icon .svg-icon {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* 导航图标样式 */
.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* 按钮图标样式 */
.btn .svg-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.btn-primary .svg-icon,
.btn-secondary .svg-icon {
  color: inherit;
}

/* 链接图标样式 */
.card-link .svg-icon,
a .svg-icon {
  transition: transform 0.3s ease;
}

.card-link:hover .svg-icon,
a:hover .svg-icon {
  transform: translateX(3px);
}

/* 统计图标样式 */
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.stat-icon .svg-icon {
  width: 36px;
  height: 36px;
  color: #139389;
}

/* 特色图标样式 */
.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.feature-icon .svg-icon {
  width: 28px;
  height: 28px;
  color: #139389;
}

/* 头部信息栏图标 */
.info-bar .svg-icon {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  color: #ffffff;
}

/* Footer图标样式 */
.footer .svg-icon {
  width: 20px;
  height: 20px;
  color: #d1d5db;
  transition: color 0.3s ease;
}

.footer a:hover .svg-icon {
  color: #139389;
}

/* ========================================
   特殊用途图标样式
   ======================================== */

/* 社交媒体图标 */
.social-icon .svg-icon {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

.social-icon:hover .svg-icon {
  transform: scale(1.2) rotate(5deg);
}

/* 加载/加载状态图标 */
.loading-icon .svg-icon {
  animation: svg-icon-spin 1s linear infinite;
}

/* 成功状态图标 */
.success-icon .svg-icon {
  color: #10b981;
}

/* 错误状态图标 */
.error-icon .svg-icon {
  color: #ef4444;
}

/* ========================================
   可访问性优化
   ======================================== */
.svg-icon {
  /* 确保图标可被屏幕阅读器识别 */
  pointer-events: none;
}

.svg-icon[aria-hidden="true"] {
  /* 如果图标纯粹装饰性，隐藏它 */
  aria-hidden: true;
}

/* ========================================
   响应式调整
   ======================================== */

/* 平板设备 (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .svg-icon.xl {
    width: 56px;
    height: 56px;
  }
  
  .svg-icon.large {
    width: 42px;
    height: 42px;
  }
  
  .product-icon {
    width: 70px;
    height: 70px;
  }
  
  .product-icon .svg-icon {
    width: 35px;
    height: 35px;
  }
  
  .card-icon .svg-icon {
    width: 42px;
    height: 42px;
  }
}

/* 移动设备 (< 768px) */
@media (max-width: 767px) {
  .svg-icon {
    width: 20px;
    height: 20px;
  }
  
  .svg-icon.small {
    width: 14px;
    height: 14px;
  }
  
  .svg-icon.large {
    width: 36px;
    height: 36px;
  }
  
  .svg-icon.xl {
    width: 48px;
    height: 48px;
  }
  
  .svg-icon.xxl {
    width: 60px;
    height: 60px;
  }
  
  .product-icon {
    width: 60px;
    height: 60px;
  }
  
  .product-icon .svg-icon {
    width: 30px;
    height: 30px;
  }
  
  .card-icon .svg-icon {
    width: 36px;
    height: 36px;
  }
  
  .stat-icon .svg-icon {
    width: 28px;
    height: 28px;
  }
  
  .feature-icon .svg-icon {
    width: 24px;
    height: 24px;
  }
}

/* 小屏移动设备 (< 480px) */
@media (max-width: 479px) {
  .svg-icon.large {
    width: 32px;
    height: 32px;
  }
  
  .svg-icon.xl {
    width: 40px;
    height: 40px;
  }
  
  .svg-icon.xxl {
    width: 50px;
    height: 50px;
  }
  
  .product-icon {
    width: 50px;
    height: 50px;
  }
  
  .product-icon .svg-icon {
    width: 25px;
    height: 25px;
  }
  
  .card-icon .svg-icon {
    width: 32px;
    height: 32px;
  }
}

/* ========================================
   打印样式优化
   ======================================== */
@media print {
  .svg-icon {
    stroke-width: 1;
    fill: #000000;
    stroke: #000000;
  }
  
  .svg-icon.animated,
  .svg-icon.spin,
  .svg-icon.pulse {
    animation: none;
  }
}
