/**
 * 首页专用样式文件
 * 版本：v1.1.0
 * 优化：微信浏览器适配、响应式rem布局
 */

/* 基础样式重置 */
html {
  margin: 0;
  padding: 0;
  background: #e8f5e9;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  background: #e8f5e9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

/* 链接样式 */
a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* 顶部区域 */
.top-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}

.header-top {
  width: 100%;
  background: linear-gradient(303deg, #2f912f 0%, #228B22 100%);
  padding: 20rpx 0;
  text-align: center;
}

.site-title {
  color: #fff;
  font-size: 36rpx;
  font-weight: bold;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 主导航 */
.main-nav {
  display: flex;
  justify-content: space-around;
  padding: 16rpx 0;
  border-bottom: 1rpx solid #eee;
  background: #fff;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33.33%;
  padding: 8rpx 0;
}

.nav-item img {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  margin-bottom: 8rpx;
  background: #f5f5f5;
}

.nav-item span {
  font-size: 24rpx;
  color: #333;
  font-weight: 500;
  text-align: center;
}

/* 主体区域 */
.main-area {
  padding-top: 240rpx;
  padding-bottom: 160rpx;
  min-height: 100vh;
}

.content-area {
  padding: 0 24rpx;
}

/* 子导航列表 */
.subnav-list {
  margin-bottom: 24rpx;
}

.subnav-group {
  margin-bottom: 24rpx;
}

.subnav-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx 24rpx;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16rpx;
  margin-bottom: 16rpx;
  font-weight: bold;
  color: #fff;
  font-size: 28rpx;
}

.subnav-title i {
  font-size: 32rpx;
}

.subnav-items {
  display: flex;
  flex-direction: column;
  gap: 16rpx;
}

.subnav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20rpx 24rpx;
  background: #fff;
  border-radius: 16rpx;
  font-size: 28rpx;
  color: #333;
  transition: all 0.2s ease;
}

.subnav-item:active {
  transform: scale(0.98);
  background: #f8f8f8;
}

.subnav-item i {
  font-size: 28rpx;
  color: #5cb85c;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: 16rpx 0;
  background: #fff;
  box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.08);
  padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33.33%;
  padding: 8rpx 0;
}

.bottom-nav .nav-item i {
  font-size: 40rpx;
  margin-bottom: 4rpx;
}

.bottom-nav .nav-item span {
  font-size: 22rpx;
  color: #666;
}

.bottom-nav .nav-item.active {
  color: #5cb85c;
}

.bottom-nav .nav-item.active span {
  color: #5cb85c;
}

/* 分享弹窗 */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.share-modal-content {
  background: #fff;
  border-radius: 32rpx;
  width: 90%;
  max-width: 680rpx;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24rpx 32rpx;
  border-bottom: 1rpx solid #eee;
  font-weight: bold;
  font-size: 32rpx;
}

.share-modal-close {
  font-size: 48rpx;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.share-modal-body {
  padding: 32rpx;
}

.share-options {
  display: flex;
  justify-content: center;
  gap: 60rpx;
  margin-bottom: 32rpx;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.share-icon {
  width: 96rpx;
  height: 96rpx;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48rpx;
  margin-bottom: 16rpx;
}

.share-item:nth-child(1) .share-icon {
  background: #5cb85c;
  color: #fff;
}

.share-item:nth-child(2) .share-icon {
  background: #07c160;
  color: #fff;
}

.share-item:nth-child(3) .share-icon {
  background: #12b7f5;
  color: #fff;
}

.share-item span {
  font-size: 26rpx;
  color: #333;
}

.qrcode-section {
  text-align: center;
  padding-top: 24rpx;
  border-top: 1rpx solid #eee;
}

.qrcode-section p {
  margin-top: 16rpx;
  color: #666;
  font-size: 24rpx;
}

#qrcode {
  display: flex;
  justify-content: center;
}

#qrcode img {
  display: inline-block !important;
}

#qrcode canvas {
  display: none !important;
}

/* 滚动条隐藏 */
::-webkit-scrollbar {
  display: none;
}

/* 禁止选择文本 */
* {
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea {
  -webkit-user-select: auto;
  user-select: auto;
}

/* 图片懒加载占位 */
img[loading="lazy"] {
  background: #f5f5f5;
}

/* 媒体查询 - 大屏适配 */
@media screen and (min-width: 750px) {
  html {
    background: #e8f5e9;
  }

  body {
    max-width: 790px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
  }

  .top-area {
    max-width: 790px;
    left: auto;
    right: auto;
    margin: 0 auto;
    position: fixed;
    top: 0;
    width: 100%;
  }

  .header-top {
    width: 100%;
    max-width: 790px;
  }

  .main-nav {
    width: 100%;
    max-width: 790px;
  }

  .main-area {
    max-width: 790px;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
  }

  .content-area {
    max-width: 790px;
    margin: 0 auto;
    padding: 0 24rpx;
  }

  .subnav-list {
    max-width: 790px;
    margin: 0 auto 24rpx;
  }

  .bottom-nav {
    max-width: 790px;
    left: auto;
    right: auto;
    margin: 0 auto;
    position: fixed;
    bottom: 0;
    width: 100%;
  }
}