/**
 * 公共样式 - 手机网页版
 */

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #F2F2F7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 60px; /* 为底部导航栏留出空间 */
}

/* 🖥️ 电脑端适配：参考writerpro.cn的设计 */
@media screen and (min-width: 768px) {
  /* 页面背景 - 渐变效果 */
  body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  }

  /* 容器 - Glassmorphism效果 */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-radius: 0;
  }

  /* 底部导航栏 - Glassmorphism效果 */
  .tabbar {
    width: 1200px !important;
    max-width: 1200px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    height: 60px;
    border-radius: 0;
  }

  .tabbar-item {
    padding: 12px 0;
    transition: all 0.2s ease;
  }

  .tabbar-item:hover {
    transform: translateY(-2px);
  }

  .tabbar-item .icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
  }

  .tabbar-item .label {
    font-size: 0.85rem;
    font-weight: 500;
  }
}

/* 底部导航栏 - 手机端显示 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0 !important;
  right: 0 !important;
  height: 50px;
  background-color: #FFFFFF;
  border-top: 1px solid #E5E5EA;
  display: flex;
  justify-content: space-evenly; /* 🎯 改为space-evenly，更均匀分布 */
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding: 0 5px; /* 🎯 减小padding，从10px改为5px */
  box-sizing: border-box; /* 🎯 确保padding不会增加总宽度 */
  width: 100% !important; /* 🎯 强制宽度为100% */
  max-width: 100vw !important; /* 🎯 强制最大宽度不超过视口 */
  overflow-x: hidden; /* 🎯 隐藏横向溢出 */
  transform: none !important; /* 🎯 取消任何transform */
}

.tabbar-item {
  flex: 0 0 auto; /* 🎯 不伸缩，固定宽度 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #8E8E93;
  transition: all 0.3s ease;
  padding: 5px 2px; /* 🎯 进一步减小padding */
  position: relative;
  min-width: 0; /* 🎯 允许收缩 */
  max-width: 22%; /* 🎯 限制最大宽度为22%（4个项目） */
}

.tabbar-item.active {
  color: #FFFFFF; /* 🎯 选中时文字变白色 */
}

/* 🎯 隐藏底部导航栏图标 */
.tabbar-icon {
  display: none;
}

.tabbar-text {
  font-size: 11px; /* 🎯 从12px进一步减小到11px */
  margin-top: 0;
  padding: 5px 10px; /* 🎯 从6px 12px进一步减小到5px 10px */
  border-radius: 20px; /* 🎯 椭圆形状 */
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap; /* 🎯 防止文字换行 */
  overflow: hidden; /* 🎯 隐藏溢出 */
  text-overflow: ellipsis; /* 🎯 文字溢出显示省略号 */
  max-width: 100%; /* 🎯 最大宽度不超过父元素 */
}

/* 🎯 选中状态：橙色椭圆背景 */
.tabbar-item.active .tabbar-text {
  background: linear-gradient(135deg, #FF7E5F 0%, #FF6B35 100%); /* 🎯 橙色渐变背景 */
  color: #FFFFFF; /* 🎯 白色文字 */
  font-weight: 600; /* 🎯 加粗文字 */
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); /* 🎯 添加阴影 */
}

/* 微信适配器样式 */
.wx-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.wx-loading-content {
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.wx-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.wx-loading-text {
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

/* Toast样式 */
.wx-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wx-toast.show {
  opacity: 1;
}

.wx-toast-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.wx-toast-text {
  font-size: 14px;
  text-align: center;
}

/* Modal样式 */
.wx-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.wx-modal {
  background-color: #fff;
  border-radius: 12px;
  width: 80%;
  max-width: 300px;
  overflow: hidden;
}

.wx-modal-header {
  padding: 20px 20px 10px;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  color: #000;
}

.wx-modal-content {
  padding: 10px 20px 20px;
  font-size: 14px;
  color: #666;
  text-align: center;
  line-height: 1.6;
}

.wx-modal-footer {
  display: flex;
  border-top: 1px solid #E5E5EA;
}

.wx-modal-btn {
  flex: 1;
  padding: 15px;
  border: none;
  background: none;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.wx-modal-btn.cancel {
  color: #666;
  border-right: 1px solid #E5E5EA;
}

.wx-modal-btn.confirm {
  color: #FF6B35;
  font-weight: 600;
}

.wx-modal-btn:active {
  background-color: #F2F2F7;
}

/* 通用按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: #F2F2F7;
  color: #333;
}

.btn-secondary:hover {
  background-color: #E5E5EA;
}

/* 卡片样式 */
.card {
  background-color: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 输入框样式 */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E5E5EA;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: #FF6B35;
}

/* 文本域样式 */
.textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E5E5EA;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.textarea:focus {
  outline: none;
  border-color: #FF6B35;
}

/* 隐藏类 */
.hidden {
  display: none !important;
}

/* 文本对齐 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* 间距工具类 */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }

.pt-10 { padding-top: 10px; }
.pt-20 { padding-top: 20px; }
.pb-10 { padding-bottom: 10px; }
.pb-20 { padding-bottom: 20px; }
.pl-10 { padding-left: 10px; }
.pr-10 { padding-right: 10px; }

/* ========== 支付弹窗样式 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.payment-modal-content {
  max-width: 450px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #E5E5EA;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #000;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 20px;
}

.payment-card-header {
  margin-bottom: 20px;
}

.payment-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-icon-wrapper {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.payment-title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.payment-subtitle {
  font-size: 12px;
  color: #666;
  margin: 0;
}

.qr-code-display-area {
  background: #F8F9FA;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-placeholder {
  text-align: center;
  color: #999;
}

.qr-code-placeholder svg {
  margin-bottom: 10px;
  opacity: 0.5;
}

.qr-code-placeholder p {
  margin: 5px 0;
  font-size: 14px;
}

.qr-code-container {
  text-align: center;
  width: 100%;
}

.qr-code-container img {
  width: 200px;
  height: 200px;
  margin: 0 auto 15px;
  display: block;
}

.qr-code-info {
  margin-bottom: 15px;
}

.qr-code-title {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  margin: 0 0 5px 0;
}

.qr-code-service {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.security-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
}

.tip-item svg {
  color: #07C160;
}

.final-price-display {
  background: #F8F9FA;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: center;
}

.final-price-display p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.final-price-display span {
  color: #FF3B30;
  font-size: 20px;
}

.agreement-section {
  margin: 15px 0;
}

.payment-methods {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.payment-method-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid #E5E5EA;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  transition: all 0.3s;
}

.payment-method-btn:hover {
  border-color: #8A2BE2;
}

.payment-method-btn.active {
  border-color: #8A2BE2;
  background: #F5F0FF;
  color: #8A2BE2;
}

.payment-method-btn.alipay.active {
  border-color: #00A0E9;
  background: #E6F7FF;
  color: #00A0E9;
}

.payment-method-btn.wechat.active {
  border-color: #07C160;
  background: #E6F9F0;
  color: #07C160;
}

.security-assurance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #F8F9FA;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
}

.security-assurance svg {
  color: #07C160;
}

