/* 上海威泉泵业官网样式 */

/* ========== 基础样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #0055aa;
  --secondary-color: #ff6600;
  --dark-color: #1a1a2e;
  --light-color: #f5f5f5;
  --text-color: #333;
  --text-light: #666;
  --white: #fff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ========== 头部导航 ========== */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #003366 100%);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

.lang-switch-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 1px;
  min-width: 48px;
}

.lang-switch-btn:hover {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-1px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
}

.logo-img {
  height: 48px;
  width: auto;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 2px;
  line-height: 1.2;
}

.logo .subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
  display: block;
  margin-top: 2px;
}

.nav-list {
  display: flex;
  gap: 40px;
}

.nav-list a {
  color: var(--white);
  font-size: 1.05rem;
  padding: 10px 0;
  position: relative;
  transition: var(--transition);
}

.nav-list a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--secondary-color);
  transition: var(--transition);
}

.nav-list a:hover::after,
.nav-list a.active::after {
  width: 100%;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--secondary-color);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* ========== 主要内容区 ========== */
main {
  flex: 1;
}

/* ========== 轮播图 ========== */
.carousel-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 0;
}

#carouselContainer {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.carousel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 600px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* 视口：所有 slide 绝对定位叠加 */
.carousel-viewport {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 单个 slide：默认隐藏，激活时显示 */
.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* 图片包装层 */
.carousel-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #0055aa 0%, #003366 100%);
}

/* 真实图片 */
.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 占位图（图片未加载或失败时显示） */
.carousel-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  text-align: center;
}

.placeholder-icon {
  font-size: 6rem;
  margin-bottom: 20px;
}

.placeholder-text {
  font-size: 1rem;
  opacity: 0.7;
}

/* 文字说明 */
.carousel-caption {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--white);
  background: rgba(0, 51, 102, 0.85);
  padding: 20px 40px;
  border-radius: 10px;
  max-width: 600px;
  z-index: 2;
}

.carousel-caption h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.carousel-caption p {
  font-size: 1.1rem;
  opacity: 0.95;
}

/* 左右切换按钮 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  line-height: 1;
  font-family: inherit;
}

.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }

.carousel-arrow:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* 圆点指示器 */
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.carousel-dot.active {
  background: var(--secondary-color);
  transform: scale(1.2);
}

/* ========== 首页模块 ========== */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.section-title p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-top: 20px;
}

/* 特点介绍 */
.features {
  background: var(--light-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), #0077cc);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2.5rem;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.feature-card p {
  color: var(--text-light);
  line-height: 1.8;
}

/* 产品推荐 */
.products-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.product-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-info {
  padding: 25px;
}

.product-info h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.product-info p {
  color: var(--text-light);
  margin-bottom: 15px;
}

.product-link {
  color: var(--primary-color);
  font-weight: 600;
  transition: var(--transition);
}

.product-link:hover {
  color: var(--secondary-color);
}

/* ========== 留言板 ========== */
.message-board {
  background: var(--light-color);
}

.message-form {
  max-width: 700px;
  margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.submit-btn {
  width: 100%;
  padding: 15px 30px;
  background: linear-gradient(135deg, var(--primary-color), #0077cc);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.submit-btn:hover {
  background: linear-gradient(135deg, #003366, var(--primary-color));
  transform: translateY(-2px);
}

/* 留言列表 */
.message-list {
  max-width: 700px;
  margin: 50px auto 0;
}

.message-list h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--dark-color);
}

.message-item {
  background: var(--white);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-item .message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.message-item .author {
  font-weight: 600;
  color: var(--primary-color);
}

.message-item .date {
  color: #999;
  font-size: 0.9rem;
}

.message-item .content {
  color: var(--text-color);
  line-height: 1.7;
}

/* ========== 关于我们 ========== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-image {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

.about-text h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.about-text p {
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.9;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  color: var(--text-light);
  margin-top: 5px;
}

/* 公司优势 */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.advantage-item {
  background: var(--white);
  padding: 30px;
  border-radius: 10px;
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow);
}

.advantage-item h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.advantage-item p {
  color: var(--text-light);
}

/* ========== 产品中心 ========== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.products-full-card {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.products-full-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.products-full-card .product-image {
  height: 250px;
}

.products-full-card .product-info {
  padding: 25px;
}

.products-full-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.products-full-card p {
  color: var(--text-light);
  margin-bottom: 15px;
}

.products-full-card .specs {
  background: var(--light-color);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.products-full-card .specs span {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 3px;
}

/* ========== 联系我们 ========== */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.contact-info-card {
  background: var(--white);
  padding: 40px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.contact-info-card h3 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--primary-color);
}

.info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 25px;
}

.info-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), #0077cc);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.info-text h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: var(--dark-color);
}

.info-text p {
  color: var(--text-light);
}

.contact-form-card {
  background: var(--white);
  padding: 40px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.contact-form-card h3 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--primary-color);
}

/* ========== 页脚 ========== */
.footer {
  background: var(--dark-color);
  color: var(--white);
  padding: 50px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  display: block;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 15px;
  }
  
  .header-right {
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }
  
  .lang-switch-btn {
    align-self: center;
  }
  
  .nav-list {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    padding: 10px 0;
  }
  
  .nav-list.active {
    display: flex;
  }
  
  .nav-list li a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .mobile-menu-btn {
    display: flex;
    position: absolute;
    right: 20px;
    top: 25px;
  }
  
  .carousel {
    height: 350px;
  }
  
  .carousel-caption {
    padding: 15px 20px;
    bottom: 50px;
  }
  
  .carousel-caption h2 {
    font-size: 1.4rem;
  }
  
  .carousel-caption p {
    font-size: 0.95rem;
  }
  
  .section {
    padding: 50px 0;
  }
  
  .section-title h2 {
    font-size: 1.8rem;
  }
  
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .about-image {
    height: 300px;
  }
  
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .contact-content {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .message-form {
    padding: 25px;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .carousel {
    height: 280px;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .products-preview,
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .advantages-grid {
    grid-template-columns: 1fr;
  }
  
  .about-stats {
    grid-template-columns: 1fr;
  }
}

/* ========== 动画效果 ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid var(--light-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
