/* ============================================
   现代化响应式网站样式
   简洁大气设计
   ============================================ */

:root {
  --primary-color: #d4a574;
  --primary-dark: #a67c52;
  --primary-light: #e5c9a8;
  --text-dark: #333333;
  --text-light: #666666;
  --bg-light: #f8f6f1;
  --bg-white: #ffffff;
  --border-color: #e0ddd8;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   头部样式
   ============================================ */

.header-top {
  background-color: var(--text-dark);
  color: #ffffff;
  padding: 12px 0;
  font-size: 14px;
}

.header-top-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-contact {
  color: #ff6b6b;
  font-weight: 600;
}

header {
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  min-width: 250px;
}

.logo h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* 导航菜单 */
nav ul {
  list-style: none;
  display: flex;
  gap: 0;
}

nav li {
  flex: 1;
}

nav a {
  display: block;
  padding: 25px 20px;
  color: var(--text-dark);
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
}

nav a:hover,
nav li.active a {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* 汉堡菜单 */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  color: var(--text-dark);
}

/* 响应式设计 - 平板 */
@media (max-width: 768px) {
  .header-content {
    height: 60px;
  }

  .logo {
    min-width: auto;
    flex: 1;
    overflow: hidden;
  }

  .logo h1 {
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    overflow: hidden;
  }

  .logo h1 img {
    flex-shrink: 0;
    height: 30px !important;
  }

  .logo h1 span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }

  nav ul {
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: var(--shadow-md);
  }

  nav ul.active {
    max-height: 500px;
  }

  nav li {
    flex: none;
  }

  nav a {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    text-align: left;
  }

  nav a:hover,
  nav li.active a {
    border-bottom-color: var(--text-dark);
    border-left-color: var(--primary-color);
  }

  .nav-toggle {
    display: block;
    order: -1;
  }

  .header-top-content {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ============================================
   页面容器
   ============================================ */

main {
  min-height: calc(100vh - 200px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary-color);
}

/* ============================================
   首页轮播
   ============================================ */

.banner {
  position: relative;
  width: 100%;
  height: 400px;
  background-color: var(--text-dark);
  overflow: hidden;
  margin-bottom: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.banner-item {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  top: 0;
  left: 0;
}

.banner-item.active {
  opacity: 1;
}

.banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 左右箭头按钮 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 20;
  transition: all 0.3s ease;
}

.banner-arrow:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.banner-arrow-prev {
  left: 15px;
}

.banner-arrow-next {
  right: 15px;
}

.banner-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.banner-dot.active {
  background-color: var(--primary-color);
  width: 30px;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .banner {
    height: 250px;
  }

  .banner-arrow {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .banner-arrow-prev {
    left: 8px;
  }

  .banner-arrow-next {
    right: 8px;
  }
}

/* ============================================
   卡片组件
   ============================================ */

.card {
  background-color: var(--bg-white);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 30px;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header {
  padding: 20px;
  background-color: var(--primary-light);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 18px;
}

.card-body {
  padding: 20px;
}

.card-body p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 15px;
}

.card-body p:last-child {
  margin-bottom: 0;
}

/* ============================================
   产品/案例网格
   ============================================ */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.gallery-item {
  position: relative;
  background-color: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
}

.gallery-item-image {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-title {
  padding: 15px;
  font-weight: 600;
  color: var(--text-dark);
  background-color: var(--bg-light);
  text-align: center;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .gallery-item-image {
    height: 150px;
  }
}

/* ============================================
   两列布局（桌面端）
   ============================================ */

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.content-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.content-text h2 {
  font-size: 24px;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.content-text p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ============================================
   侧边栏信息框
   ============================================ */

.info-card {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary-color);
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
}

.info-card h3 {
  color: var(--primary-dark);
  margin-bottom: 15px;
  font-size: 16px;
}

.info-card p {
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 14px;
}

.info-card a {
  color: var(--primary-dark);
  font-weight: 600;
}

/* ============================================
   按钮组件
   ============================================ */

.btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--primary-color);
  color: var(--bg-white);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 16px;
  text-align: center;
}

.btn:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
}

/* ============================================
   底部
   ============================================ */

footer {
  background-color: var(--text-dark);
  color: var(--bg-light);
  padding: 40px 20px;
  text-align: center;
  margin-top: 60px;
}

footer p {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.8;
}

footer a {
  color: var(--primary-light);
}

footer a:hover {
  color: var(--primary-color);
}

/* ============================================
   返回顶部按钮
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: var(--bg-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 999;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.back-to-top.show {
  display: flex;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* ============================================
   响应式文本
   ============================================ */

@media (max-width: 768px) {
  main {
    padding: 20px 15px;
  }

  .page-title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  h2 {
    font-size: 20px !important;
  }

  p {
    font-size: 14px !important;
  }
}

/* ============================================
   图片预览（Lightbox）
   ============================================ */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox.show {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background-color: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.lightbox-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--text-dark);
  min-height: 300px;
  overflow: hidden;
}

.lightbox-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

.lightbox-info {
  padding: 15px 20px;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 14px;
  color: var(--text-dark);
}

/* Lightbox 控制按钮 */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  border: none;
  font-size: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 100;
  transition: all 0.3s ease;
}

.lightbox-arrow:hover {
  background-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-arrow-prev {
  left: 15px;
}

.lightbox-arrow-next {
  right: 15px;
}

/* Lightbox 关闭按钮 */
.lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 45px;
  height: 45px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 101;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background-color: rgba(0, 0, 0, 0.9);
  transform: rotate(90deg);
}

/* Lightbox 计数器 */
.lightbox-counter {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 101;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .lightbox-arrow {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox-arrow-prev {
    left: 8px;
  }

  .lightbox-arrow-next {
    right: 8px;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 24px;
    top: 10px;
    right: 10px;
  }

  .lightbox-counter {
    top: 10px;
    left: 10px;
    font-size: 11px;
  }
}

/* ============================================
   实用工具类
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-light);
}

.mt {
  margin-top: 20px;
}

.mb {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

.invisible {
  visibility: hidden;
}
