/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Alibaba PuHuiTi 3", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  color: #333;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  -webkit-touch-callout: none; /* iOS 长按不弹出菜单 */
}

/* 微信专属样式 */
.wx-content {
  background: #f5f5f5;
}

.wx-content .card {
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #eee;
  margin: 0;
  padding: 15px;
}

.wx-content .card:hover {
  transform: none;
  box-shadow: none;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}

/* 搜索栏样式 */
.search-bar {
  display: flex;
  align-items: center;
  margin: 20px auto;
  width: 90%;
  height: 48px;
  background-color: #fff;
  border-radius: 24px;
  border: 1px solid #e0e0e0;
  padding: 0 20px;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: #4a90e2;
  box-shadow: 0 2px 12px rgba(74, 144, 226, 0.2);
}

.search-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  opacity: 0.6;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 0 10px;
  color: #333;
}

.search-button {
  border: none;
  background: none;
  color: #4a90e2;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 8px;
  transition: opacity 0.2s;
}

.search-button:hover {
  opacity: 0.8;
}

/* 导航和logo */
.nav {
  padding: 0 15px;
  margin-bottom: 10px;
}

.logo {
  width: 80px;
  height: auto;
  margin: 10px 0;
}

/* 卡片样式 */
.card {
  margin: 10px !important;
  padding: 20px;
  background-color: #fff;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.card-content {
  font-size: 16px;
  line-height: 1.8;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2c3e50;
  position: relative;
  padding-bottom: 8px;
}

.card-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #4a90e2, #5cb8ff);
  border-radius: 3px;
}

/* 图片容器 每行一个*/
.image-container {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  padding: 0 5px;
}

.promo-image {
  width: 48%;
  margin: 0 1%;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}
/* 图片容器 每行二个*/
.image-container-two {
  display: flex;
  flex-wrap: wrap;
  margin: 15px 0;
  padding: 0 5px;
}
.promo-image-two {
  width: 48%;
  height: 200px;
  margin: 1%;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

/* 视频容器 */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  border-radius: 8px;
  object-fit: contain;
  /* 默认内联播放，移动端通过JS控制 */
}

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}

.modal-img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 25px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  opacity: 0.8;
}

.close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* 微信特定样式 */
.wx-content {
  overflow-x: hidden;
  word-break: break-all;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
  .search-bar {
    height: 44px;
    padding: 0 16px;
  }

  .promo-image {
    width: 46%;
    margin: 0 2%;
  }

  .card {
    padding: 16px;
  }
}

/* 返回顶部按钮样式 */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 40px !important;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-to-top:hover {
  transform: scale(1.1);
}

.back-to-top img {
  width: 35px;
  height: 35px;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  animation: fadeIn 0.5s ease;
}

/* 微信环境下按钮调整 */
.wx-content .share-button,
.wx-content .back-to-top {
  right: 10px;
  bottom: 60px;
  width: 44px;
  height: 44px;
}

.wx-content .back-to-top {
  bottom: 10px;
}

/* 简易加载动画 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  padding: 20px;
  gap: 10px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #4a90e2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
