/*
 * 上海安弗真空技术有限公司 — 组件样式 (Components CSS)
 * 包含：按钮、卡片、标签、轮播、Tab切换、表单等复用组件
 * 版本: 2.0
 */

/* ===================== 区块标题 ===================== */
.section-title {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-title h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
}

.section-title p {
  font-size: var(--text-base);
  color: var(--text-gray);
  margin-bottom: var(--space-sm);
}

.section-title .divider {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--primary);
  margin: 0 auto;
  border-radius: 2px;
}

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--text-white);
}

.btn-accent {
  background: var(--accent);
  color: var(--text-white);
  border-radius: var(--radius-sm);
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: var(--text-white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-light {
  background: var(--bg-white);
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.btn-light:hover {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
}

.btn-sm {
  padding: 6px 16px;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 14px 32px;
  font-size: var(--text-lg);
}

/* ===================== 产品卡片 ===================== */
.product-card {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
  border: 1px solid var(--border-color);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.product-card-img {
  display: block;
  height: 240px;
  text-align: center;
  overflow: hidden;
  background: var(--bg-white);
  position: relative;
}

.product-card-img::after {
  content: '';
  display: inline-block;
  height: 100%;
  width: 0;
  vertical-align: middle;
}

.product-card-img img {
  max-width: 85%;
  max-height: 85%;
  vertical-align: middle;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card-img img {
  transform: scale(1.08);
}

.product-card-tags {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.product-card-body {
  padding: var(--space-md);
}

.product-card-title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  padding: 10px var(--space-md);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 40px;
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.product-card:hover .product-card-title {
  color: var(--primary);
}

.product-card-source {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 0 var(--space-md) 8px;
  letter-spacing: 0.5px;
  transition: color var(--transition-fast);
}

.product-card:hover .product-card-source {
  color: var(--text-gray);
}

.product-card-desc-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px var(--space-md);
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.product-card:hover .product-card-desc-overlay {
  transform: translateY(0);
}

.product-card-desc-overlay span {
  color: var(--text-white);
  font-size: var(--text-xs);
  text-align: center;
  line-height: var(--leading-normal);
}

/* 产品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.product-grid.three-col {
  grid-template-columns: repeat(3, 1fr);
}

/* ===================== 标签 ===================== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  line-height: 20px;
}

.tag-info {
  background: #dbeafe;
  color: #1e40af;
}

.tag-success {
  background: #d1fae5;
  color: #065f46;
}

.tag-warning {
  background: #fef3c7;
  color: #92400e;
}

.tag-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ===================== 分类Tab ===================== */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-xl);
}

.filter-tab {
  padding: 9px 24px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-gray);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
}

/* ===================== 首页 Banner 轮播 ===================== */
.hero-slider {
  position: relative;
  width: 100%;
  height: 580px;
  overflow: hidden;
  background: #1e2d3d;
}
/* 半透明遮罩 */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 2;
  pointer-events: none;
}

/* 文字内容叠加层 */
.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 3;
  pointer-events: none;
}

.hero-content-inner {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
  pointer-events: auto;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-md);
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
  letter-spacing: 2px;
  animation: fadeInUp 1s ease;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: rgba(255,255,255,0.92);
  margin-bottom: var(--space-xl);
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
  max-width: 560px;
  line-height: var(--leading-relaxed);
  animation: fadeInUp 1s ease 0.15s both;
}

.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-size: var(--text-lg);
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: all var(--transition-base);
  animation: fadeInUp 1s ease 0.3s both;
}

.hero-cta-btn:hover {
  color: #fff;
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.hero-cta-btn i {
  transition: transform var(--transition-fast);
}

.hero-cta-btn:hover i {
  transform: translateX(4px);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  position: relative;
  z-index: 4;
}

.hero-dot.active {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  width: 28px;
  border-radius: 5px;
}

.hero-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  cursor: pointer;
  z-index: 4;
  opacity: 1;
  transition: background var(--transition-fast);
}

.hero-slider-arrow:hover {
  background: rgba(0, 0, 0, 0.45);
}

.hero-slider-arrow.prev {
  left: 20px;
}

.hero-slider-arrow.next {
  right: 20px;
}

/* ===================== 优势卡片 ===================== */
.advantage-card {
  text-align: center;
  padding: var(--space-lg);
  transition: transform var(--transition-base);
}

.advantage-card:hover {
  transform: translateY(-6px);
}

.advantage-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-lg);
  background: var(--bg-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: var(--primary);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.advantage-card:hover .advantage-icon {
  background: var(--primary);
  color: var(--text-white);
  box-shadow: var(--shadow-md);
}

.advantage-card h4 {
  font-size: var(--text-xl);
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
}

.advantage-card p {
  font-size: var(--text-sm);
  color: var(--text-gray);
  line-height: var(--leading-relaxed);
}

.advantage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ===================== 场景卡片 ===================== */
.scene-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.scene-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.scene-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.scene-card:hover img {
  transform: scale(1.12);
}

.scene-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-md);
  background: rgba(0,0,0,0.5);
  color: var(--text-white);
  font-size: var(--text-lg);
  text-align: center;
  font-weight: 600;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ===================== 新闻组件 ===================== */
.news-featured {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: box-shadow var(--transition-base);
}

.news-featured:hover {
  box-shadow: var(--shadow-md);
}

.news-featured-img {
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.news-featured-img a {
  display: block;
  height: 240px;
}

.news-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 4s ease;
}

.news-featured-img a:hover img {
  transform: scale(1.08);
}

.news-featured-body {
  flex: 1;
  min-height: 0;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  overflow: hidden;
}

.news-featured-body h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
  flex-shrink: 0;
}

.news-featured-body h3 a {
  color: var(--text-dark);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-featured-body h3 a:hover {
  color: var(--primary);
}

.news-featured-body .desc {
  font-size: var(--text-sm);
  color: var(--text-gray);
  line-height: var(--leading-relaxed);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  margin-bottom: var(--space-md);
}

.news-featured-body .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.news-more-link {
  display: inline-block;
  background: var(--primary);
  color: var(--text-white);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
}

.news-more-link:hover {
  background: var(--primary-dark);
  color: var(--text-white);
}

.news-list-item {
  display: flex;
  background: var(--bg-white);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-fast);
  min-height: 120px;
  flex: 1;
}

.news-list-item:last-child {
  margin-bottom: 0;
}

.news-list-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.news-list-item .date-badge {
  width: 80px;
  flex-shrink: 0;
  text-align: center;
  background: #cacaca;
  color: var(--text-white);
  border-radius: var(--radius-sm) 0 var(--radius-sm) 0;
  padding: var(--space-sm) 0;
  position: absolute;
  left: var(--space-lg);
  top: var(--space-lg);
  transition: background var(--transition-fast);
}

.news-list-item:hover .date-badge {
  background: var(--accent);
}

.news-list-item .date-badge .day {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.news-list-item .date-badge .month {
  font-size: var(--text-sm);
}

.news-list-item .item-content {
  padding-left: 100px;
}

.news-list-item .item-content h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-sm);
}

.news-list-item .item-content h4 a {
  color: var(--text-dark);
}

.news-list-item:hover .item-content h4 a {
  color: var(--primary);
}

.news-list-item .item-content .excerpt {
  font-size: var(--text-sm);
  color: var(--text-gray);
  line-height: var(--leading-relaxed);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===================== 客户反馈轮播 ===================== */
.testimonial-carousel {
  padding: var(--space-lg) 0;
}

.testimonial-item {
  padding: 10px;
}

.testimonial-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px var(--space-lg);
  box-shadow: var(--shadow-sm);
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  border-radius: 4px 0 0 4px;
}

.testimonial-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.testimonial-card .quote {
  font-size: var(--text-sm);
  color: var(--text-body);
  line-height: var(--leading-relaxed);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  position: relative;
  padding-left: 28px;
  flex: 1;
}

.testimonial-card .quote::before {
  content: '\201C';
  position: absolute;
  left: 0;
  top: -4px;
  font-size: 36px;
  color: var(--primary);
  line-height: 1;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  opacity: 0.35;
}

.testimonial-card .author {
  text-align: right;
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 600;
}

.testimonial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--border-color);
}

.testimonial-footer .stars {
  color: #f59e0b;
  font-size: var(--text-sm);
  letter-spacing: 2px;
}

/* ===================== 合作伙伴 ===================== */
.partner-section {
  text-align: center;
  padding: var(--space-xl) 0;
}

.partner-section img {
  max-width: 85%;
  width: 100%;
  transition: transform var(--transition-base), filter var(--transition-base);
  filter: grayscale(20%);
}

.partner-section img:hover {
  transform: scale(1.03);
  filter: grayscale(0%);
}

/* ===================== 产品详情 ===================== */
.product-showcase {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.product-showcase-img {
  width: 45%;
  flex-shrink: 0;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.product-showcase-img img {
  max-width: 85%;
  max-height: 320px;
}

.product-showcase-info {
  flex: 1;
}

.product-showcase-info .product-name {
  font-size: var(--text-2xl);
  color: var(--primary);
  margin-bottom: var(--space-lg);
  font-weight: 700;
}

.product-showcase-info .product-brief {
  background: var(--bg-light);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-gray);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
}

.product-specs {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.product-specs li {
  display: inline-block;
  width: 48%;
  font-size: var(--text-sm);
  color: var(--text-gray);
  line-height: 2.2;
}

.product-specs li i {
  color: var(--primary);
  margin-right: var(--space-sm);
}

.product-specs li span {
  font-weight: 600;
  color: var(--text-dark);
}

.product-actions {
  display: flex;
  gap: var(--space-md);
}

.product-actions .btn {
  flex: 1;
  height: 50px;
  font-size: var(--text-base);
}

/* ===================== 详情 Tab ===================== */
.detail-tabs {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-xl);
}

.detail-tab-nav {
  display: flex;
  gap: var(--space-sm);
}

.detail-tab-nav span {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-gray);
  cursor: pointer;
  border: 1px solid var(--border-color);
  border-bottom: none;
  background: var(--bg-light);
  transition: all var(--transition-fast);
}

.detail-tab-nav span.active {
  background: var(--bg-white);
  color: var(--text-dark);
  border-bottom-color: var(--bg-white);
  margin-bottom: -1px;
}

.detail-tab-panel {
  display: none;
  padding: var(--space-lg) 0;
}

.detail-tab-panel.active {
  display: block;
}

.detail-tab-panel .content {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}

.detail-tab-panel .content img {
  max-width: 80%;
  height: auto !important;
  margin: var(--space-lg) 0;
}

/* ===================== 表格 ===================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.data-table thead th {
  background: var(--bg-light);
  font-weight: 700;
  color: var(--text-dark);
}

.data-table tbody tr:hover {
  background: var(--primary-light);
}

/* ===================== 分页 ===================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-xl) 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-gray);
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.pagination a:hover,
.pagination .current {
  background: var(--primary);
  color: var(--text-white);
}

/* ===================== 消息提示 ===================== */
.message-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  z-index: 99999;
  animation: fadeInUp 0.3s ease;
}

.message-toast.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message-toast.warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.message-toast.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}