header {
  height: 60px;
  background: #1f2937;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 40px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#header,
#header-placeholder {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 60px; /* 确保即使header内容未加载也有高度 */
  background: #1f2937; /* 设置背景色，避免空白 */
}

#header header,
#header-placeholder header {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 60px; /* 确保高度 */
}

header .logo {
  font-weight: bold;
  display: flex;
  font-size: 20px;
}

header .CS2CT {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 20px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

header .CS2CT:hover {
  opacity: 0.8;
}

header .CS2CT .logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

header .CS2CT .logo-text {
  color: #fff;
}

header nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

header nav a {
  color: #fff;
  text-decoration: none;
}

/* 登录/用户按钮靠右 */
header nav .user-menu,
header nav .login-link {
  margin-left: auto;
}

/* 公告栏样式 */
.announcement-bar {
  width: 100%;
  background-color: #fef3c7; /* 浅黄色 */
  padding: 8px 20px;
  text-align: center;
  box-sizing: border-box;
}

.announcement-text {
  color: #78350f; /* 深棕色，确保在浅黄色背景上清晰可读 */
  font-size: 13px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 1fr; /* 主内容区域 */
  gap: 16px;
  padding: 16px;
  padding-left: 192px; /* 左侧广告宽度(160px) + gap(16px) + padding(16px) */
  padding-right: 192px; /* 右侧广告宽度(160px) + gap(16px) + padding(16px) */
  align-items: start;
  min-width: 0; /* 允许grid容器收缩 */
  position: relative;
  max-width: 100%;
}

/* 响应式布局：当视口宽度不足时隐藏广告位 */
@media (max-width: 1200px) {
  .layout {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .layout .ad {
    display: none; /* 隐藏广告位 */
  }
}

/* 缩放超过阈值时隐藏广告区域 */
.layout.hide-ads {
  padding-left: 16px;
  padding-right: 16px;
}

.layout.hide-ads .ad {
  display: none;
}

.ad {
  /* 广告区域固定定位，垂直居中，大小固定不受缩放影响 */
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  position: fixed;
  width: 160px !important; /* 固定宽度，使用!important确保不被覆盖 */
  height: 300px !important; /* 固定高度，使用!important确保不被覆盖 */
  top: 50%; /* 垂直居中 */
  transform: translateY(-50%) !important; /* 垂直居中，使用!important确保不被覆盖 */
  z-index: 100;
  border-radius: 8px;
  overflow: hidden;
  /* 防止浏览器缩放影响 */
  transform-origin: center !important;
  -webkit-transform-origin: center !important;
  /* 额外的保护措施 */
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  /* 确保在所有缩放情况下保持固定大小 */
  min-width: 160px !important;
  max-width: 160px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  box-sizing: border-box !important;
}

/* 左侧广告位置 */
.layout .ad:first-of-type {
  left: 16px;
}

/* 右侧广告位置 */
.layout .ad:last-of-type {
  right: 16px;
}

/* ===== Footer 样式 ===== */
.site-footer {
  background: #f5f6f7;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
  padding: 40px 20px 20px;
  color: #374151;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: start;
  gap: 100px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e5e7eb;
}

/* 左侧品牌区域 */
.footer-brand {
  display: flex;
  align-items: flex-start;
}

.brand-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  font-size: 26px;
  font-weight: bold;
  color: #f97316;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.brand-slogan {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 2px;
}

/* 中间链接区域 */
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 30px;
  padding: 0;
  width: max-content;
}

.footer-column {
  display: flex;
  flex-direction: column;
}

.footer-column-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 12px 0;
}

.footer-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #f97316;
}

/* 右侧二维码区域 */
.footer-qrcodes {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
}

.qrcode-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qrcode-image-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qrcode-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.qrcode-image:hover {
  opacity: 0.9;
}

/* 二维码放大气泡 */
.qrcode-zoom-bubble {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(0, 0, 0, 0.5);
}

.qrcode-zoom-bubble.active {
  display: block;
  pointer-events: auto;
  opacity: 1;
}

.qrcode-zoom-content {
  position: absolute;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 12px;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-zoom-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.qrcode-zoom-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.qrcode-zoom-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.qrcode-zoom-close:active {
  transform: scale(0.95);
}

.qrcode-icon {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.qrcode-icon-qq {
  background: #12b7f5;
}

.qrcode-icon-wechat {
  background: #07c160;
}

.qrcode-icon-douyin {
  background: #ff0050;
}

.qrcode-label {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

/* 底部版权区域 */
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 20px;
}

.footer-bottom-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.footer-copyright {
  font-size: 13px;
  color: #6b7280;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.footer-separator {
  color: #d1d5db;
}

.footer-icp,
.footer-disclaimer,
.footer-data-note {
  white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .footer-container {
    gap: 100px;
  }
  
  .footer-links {
    grid-template-columns: repeat(2, max-content);
    gap: 20px;
  }
  
  .footer-qrcodes {
    gap: 15px;
  }
  
  .qrcode-image-wrapper {
    width: 90px;
    height: 90px;
  }
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 30px;
  }
  
  .footer-brand {
    justify-content: center;
  }
  
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    padding: 0;
  }
  
  .footer-qrcodes {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .footer-legal {
    flex-direction: column;
    gap: 4px;
  }
  
  .footer-separator {
    display: none;
  }
}

@media (max-width: 480px) {
  .site-footer {
    padding: 30px 16px 16px;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .footer-qrcodes {
    flex-direction: column;
    align-items: center;
  }
  
  .qrcode-image-wrapper {
    width: 90px;
    height: 90px;
  }
  
  .brand-name {
    font-size: 20px;
  }
  
  .brand-slogan {
    font-size: 12px;
  }
}

