/**
 * 拼团活动样式 - 腾讯云风格
 * @author cany(3808684706)
 */

.group-buy-page {
  padding: 20px;
  /*background: #f5f7fa;*/
  min-height: 100%;
}

.el-container:nth-child(2) > .el-main {
  background: #fff;
  margin: 0;
  margin-top: calc(40px);
  border-radius: 0;
  padding: 0.24rem;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
}

.page-subtitle {
  font-size: 14px;
  color: #8c8c8c;
  margin: 0;
}

/* 加载状态 */
.loading-wrapper {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 4px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0052d9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 活动列表 - 最多3列布局 */
.activity-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ========== 活动卡片 - 腾讯云风格 ========== */
.activity-card {
  background: #fff;
  border-radius: 4px;
  border: 1px solid #e1e6ef;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-width: 460px;
  width: 100%;
  justify-self: center;
}

.activity-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: #d0d5de;
}

/* 卡片内容区 - 带背景图 */
.card-content {
  padding: 20px;
  background-image: url(../img/ac_bg.png);
  background-size: auto 160px;
  background-position: 100% 0;
  background-repeat: no-repeat;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

/* 卡片头部 */
.card-header {
  margin-bottom: 16px;
}

.card-title {
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  color: #000;
  margin: 0 0 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: color 0.2s;
  width: 100%;
}

.card-title:hover {
  color: #0052d9;
}

.card-title i {
  font-size: 20px;
  font-weight: 700;
  font-style: normal;
  color: inherit;
  flex-shrink: 0;
  margin-left: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: #97a3b7;
  margin: 0;
  line-height: 20px;
}

/* 卡片内容体 */
.card-body {
  flex: 1;
}

/* 推荐配置 - 蓝色高亮 */
.config-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.config-highlight-item {
  font-size: 20px;
  font-weight: 700;
  color: #0052d9;
  line-height: 28px;
  /* 限制2行，超出显示省略号 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 56px; /* 28px * 2 */
  word-break: break-all;
  cursor: default;
}

/* 配置描述tooltip样式 */
.el-tooltip__popper.is-light {
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  max-width: 400px;
  font-size: 14px;
  line-height: 22px;
  color: #4b5b76;
  word-break: break-all;
}

.el-tooltip__popper.is-light .popper__arrow {
  border-bottom-color: #e5e6eb;
}

.el-tooltip__popper.is-light .popper__arrow::after {
  border-bottom-color: #fff;
}

/* 附加信息 - 固定底部 */
.info-attach {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: auto;
  padding-top: 12px;
}

.info-attach-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 20px;
}

.info-attach-label {
  color: #97a3b7;
  background: #f5f7fa;
  padding: 0 8px;
  border-radius: 2px;
  margin-right: 12px;
  white-space: nowrap;
}

.info-attach-value {
  color: #181818;
}

/* ========== 卡片底部 ========== */
.card-footer {
  padding: 0;
  width: 100%;
  background: linear-gradient(86deg, #f7faff 5.22%, #f5f9ff 71.3%);
  border-top: 1px solid rgba(0, 82, 217, 0.1);
}

.card-footer-inner {
  padding: 12px 16px;
}

/* 标签和价格行 */
.tag-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* 标签区 */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 18px;
}

.tag-item {
  font-size: 12px;
  padding: 0 3px;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 16px;
  height: 18px;
  display: inline-flex;
  align-items: center;
}

.tag-discount {
  background: #fff;
  border: 1px solid #ffcfd0;
  color: #f64041;
  min-width: 39px;
  justify-content: center;
}

.tag-first {
  background: linear-gradient(90deg, #ff5800 0%, #ff7a00 100%);
  color: #fff;
  border: none;
  padding: 0 6px;
}

.tag-normal {
  background: #fff;
  border: 1px solid #d6dbe3;
  color: #4b5b76;
}

.tag-limit {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  border: none;
  padding: 0 6px;
}

/* 价格区 */
.price-section {
  text-align: right;
  flex-shrink: 0;
}

.price-current {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
}

.price-label {
  font-size: 12px;
  color: #97a3b7;
  margin-right: 2px;
}

.price-integer {
  font-size: 24px;
  font-weight: 700;
  color: #f64041;
  line-height: 1;
}

.price-decimal {
  font-size: 14px;
  font-weight: 700;
  color: #f64041;
}

.price-unit {
  font-size: 12px;
  color: #f64041;
  margin-left: 2px;
}

.price-average {
  font-size: 11px;
  color: #97a3b7;
  margin-left: 6px;
}

.price-original {
  font-size: 12px;
  color: #97a3b7;
  margin-top: 2px;
}

.price-original .value {
  text-decoration: line-through;
}

/* ========== 进度条和按钮 ========== */
.progress-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 82, 217, 0.05);
}

.progress-section {
  flex: 1;
  margin-right: 16px;
}

.progress-bar {
  height: 4px;
  background: #e8ecf2;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin-bottom: 4px;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #0052d9 0%, #4d91ff 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar-text {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #fff;
}

.progress-desc {
  font-size: 12px;
  color: #97a3b7;
  line-height: 20px;
}

.btn-join {
  background: linear-gradient(90deg, #ff7e57 0%, #ff5825 100%);
  color: #fff;
  border: none;
  border-radius: 2px;
  padding: 7px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 22px;
}

.btn-join:hover {
  background: linear-gradient(90deg, #ff6d40 0%, #f6501d 100%);
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: #fff;
  border-radius: 4px;
}

.empty-icon {
  font-size: 64px;
  color: #dcdfe6;
  margin-bottom: 20px;
}

.empty-text {
  font-size: 16px;
  color: #909399;
}

/* ========== 弹窗样式 - 腾讯云风格 ========== */

/* 拼团类型列表 */
.group-type-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.group-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e5e6eb;
  border-bottom: none;
  position: relative;
}

.group-type-item:first-child {
  border-radius: 4px 4px 0 0;
}

.group-type-item:last-child {
  border-bottom: 1px solid #e5e6eb;
  border-radius: 0 0 4px 4px;
}

.group-type-item:only-child {
  border-radius: 4px;
  border-bottom: 1px solid #e5e6eb;
}

.group-type-item:hover {
  background: #f7faff;
}

.group-type-item.active {
  border-color: #0052d9;
  background: #f2f7ff;
  z-index: 1;
}

.group-type-item.active + .group-type-item {
  border-top-color: transparent;
}

/* 左侧区域 */
.type-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.type-radio {
  width: 18px;
  height: 18px;
  border: 2px solid #dcdfe6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.group-type-item.active .type-radio {
  border-color: #0052d9;
}

.group-type-item.active .type-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #0052d9;
  border-radius: 50%;
}

.type-name {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 24px;
}

/* 右侧价格区 */
.type-price-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.type-price {
  font-size: 24px;
  font-weight: 700;
  color: #f64041;
  line-height: 32px;
}

.type-price-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 20px;
}

.type-original-price {
  color: #8c8c8c;
}

.type-discount {
  color: #00a870;
}

/* ========== 确认弹窗样式 ========== */
.confirm-content {
  line-height: 1.8;
  color: #4b5b76;
  font-size: 14px;
}

.confirm-content p {
  margin: 0 0 16px 0;
}

.confirm-content .highlight {
  color: #0052d9;
  font-weight: 600;
}

.confirm-content .discount-info {
  color: #8c8c8c;
  font-size: 13px;
}

.confirm-content .confirm-question {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e6eb;
  font-weight: 500;
  color: #1a1a1a;
  font-size: 15px;
}

/* 弹窗按钮样式 */
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.dialog-footer .el-button {
  padding: 8px 24px;
  font-size: 14px;
  border-radius: 3px;
}

.dialog-footer .el-button--default {
  border-color: #dcdfe6;
  color: #4b5b76;
}

.dialog-footer .el-button--default:hover {
  border-color: #0052d9;
  color: #0052d9;
  background: #fff;
}

.dialog-footer .el-button--primary {
  background: #0052d9;
  border-color: #0052d9;
}

.dialog-footer .el-button--primary:hover {
  background: #0040b0;
  border-color: #0040b0;
}

/* 折扣标签 */
.discount-tag {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #00a870, #00966a);
  color: #fff;
  font-size: 12px;
  border-radius: 10px;
  margin-left: 6px;
}

/* 余额不足引导充值弹窗 */
.recharge-guide-content {
  text-align: center;
  padding: 20px 0;
}

.recharge-guide-content .guide-icon {
  margin-bottom: 20px;
}

.recharge-guide-content .guide-line1 {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 12px;
}

.recharge-guide-content .guide-line2 {
  font-size: 14px;
  color: #606266;
  margin: 0;
}

/* 响应式适配 */

/* 中等屏幕 - 2列 */
@media screen and (max-width: 1200px) {
  .activity-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 960px;
  }
}

/* 小屏幕/平板 - 2列紧凑 */
@media screen and (max-width: 960px) {
  .activity-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 100%;
    padding: 0 12px;
  }

  .activity-card {
    max-width: 100%;
    min-height: auto;
  }
}

/* 手机端 - 1列 */
@media screen and (max-width: 768px) {
  .group-buy-page {
    padding: 12px;
  }

  .activity-list {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
  }

  .activity-card {
    max-width: 100%;
  }

  .card-content {
    padding: 16px;
    background-size: auto 150px;
    min-height: 150px;
  }

  .card-header {
    margin-bottom: 12px;
  }

  .card-title {
    font-size: 18px;
    line-height: 26px;
  }

  .config-highlight-item {
    font-size: 16px;
    line-height: 24px;
  }

  .info-attach {
    gap: 8px 16px;
    flex-direction: row;
  }

  .info-attach-item {
    width: auto;
  }

  .card-footer-inner {
    padding: 12px;
  }

  .tag-price-row {
    flex-direction: column;
    gap: 8px;
  }

  .price-section {
    text-align: left;
  }

  .price-current {
    justify-content: flex-start;
  }

  .progress-btn-row {
    padding: 12px;
    flex-direction: column;
    gap: 12px;
  }

  .progress-section {
    margin-right: 0;
    width: 100%;
  }

  .btn-join {
    width: 100%;
    padding: 10px 20px;
  }

  /* 弹窗响应式 */
  .group-type-dialog,
  .confirm-dialog,
  .recharge-guide-dialog {
    width: 90% !important;
  }

  .group-type-item {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .type-price-wrap {
    align-items: flex-start;
  }
}

/* 弹窗默认宽度 */
.group-type-dialog {
  width: 420px;
}

.confirm-dialog {
  width: 480px;
}

/* 免费标签样式 */
.free-tag {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #67c23a, #52a82c);
  color: #fff;
  font-size: 12px;
  border-radius: 10px;
  margin-left: 6px;
}

.price-free {
  color: #67c23a !important;
  font-weight: 700;
}
