/* 基础容器样式 */
.content_p {
  padding: 60px 80px 0px 80px;
  background-color: #fff;
}

#modulesContainer {
  background: #fff;
  border-radius: 16px;
}

/* 大屏幕布局 - 关键修改：实现粘性定位 */
@media (min-width: 1100px) {
  .content_p {
    display: flex;
    gap: 30px;
    align-items: flex-start;
  }

  .modules-wrapper {
    flex: 1;
    min-width: 0;
    margin-top: -26px;
  }

  .price-summary-desktop {
    min-width: 380px;
    width: 24%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    /* 关键修改：添加粘性定位 */
    position: sticky;
    top: calc(60px + 1rem);
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }

  /* 移除不必要的 .show 类样式 */

  /* 滚动条样式 */
  .price-summary-desktop::-webkit-scrollbar {
    width: 4px;
  }

  .price-summary-desktop::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
  }

  .price-summary-desktop::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
  }

  /* 隐藏移动端版本 */
  .price-summary {
    display: none !important;
  }
}

/* 小屏幕布局 */
@media (max-width: 1099px) {
  .price-summary-desktop {
    display: none !important;
  }
}

/* 加载状态 */
.loading_p {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

/* 模块样式 */
.module-section {
  margin-bottom: 40px;
}

.module-title {
  font-size: 1.5rem;
  color: #1f2937;
  margin-bottom: 0px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
}

.item-card {
  background: #f1f3f8;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #ffba00;
}

.item-card.selected {
  background: rgb(255 186 0 / 12%);
  border-color: #fbbf24;
  color: #000;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.item-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #000;
}

.item-description {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
  text-align: left;
}

/* 桌面版价格摘要内容样式 */
.desktop-selected-items h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: space-between;
      line-height: calc(1rem);
}

.desktop-selected-count {
  background: rgba(255, 186, 0, 0.2);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
}

.desktop-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.desktop-selected-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.desktop-selected-tag:hover {
  background-color: rgba(255, 0, 0, 0.1);
  border-color: #ff4444;
  transform: scale(0.95);
}

.desktop-price-display {
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.desktop-original-price {
  font-size: 14px;
  color: #9ca3af;
  text-decoration: line-through;
}

.desktop-discounted-price {
  font-size: 2rem;
  font-weight: bold;
  color: #fbbf24;
}

.desktop-discount-info {
  font-size: 12px;
  color: #27ae60;
  background-color: rgba(39, 174, 96, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.desktop-action-buttons {
  display: flex;
  gap: 12px;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.empty-state .empty-icon {
  font-size: 5rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state .empty-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #d1d5db;
}

.empty-state .empty-desc {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* 移动端价格摘要 */
.price-summary {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: white;
  padding: 20px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 99999;
  opacity: 0;
}

.price-summary.show {
  transform: translateY(0);
  opacity: 1;
}

.summary-content {
  max-width: 94%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.selected-items {
  flex: 1;
  min-width: 300px;
}

.selected-items h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #888888;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.selected-tag:hover {
  background-color: rgba(255, 0, 0, 0.1);
  border-color: #ff4444;
  transform: scale(0.95);
}

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

.total-price {
  font-size: 2rem;
  color: #fbbf24;
  margin-bottom: 15px;
}

.price-container {
  text-align: right;
  line-height: 1.4;
}

.original-price {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
  float: none;
  line-height: 32px;

}

.discounted-price {
  font-size: 20px;
  font-weight: bold;
  color: #fbbf24;
}

.discount-info {
  font-size: 12px;
  color: #27ae60;
  background-color: rgba(39, 174, 96, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.action-buttons {
  display: flex;
  gap: 24px;
  margin-top: 15px;
}

/* 按钮样式 */
.btn {
  padding: 12px 0px;
  width: 50%;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #ffba00;
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(229 180 70 / 30%);
}

.btn-secondary {
  background: transparent;
  color: #d1d5db;
  border: 1px solid #374151;
}

.btn-secondary:hover {
  background: #374151;
}

/* 开关按钮样式 */
.item-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-checkbox {
  display: none;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  cursor: pointer;
  user-select: none;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #9999992b;
  border-radius: 24px;
  transition: all 0.3s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked+.toggle-label .toggle-slider {
  background-color: #fbbf24;
}

.toggle-checkbox:checked+.toggle-label .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-label:hover .toggle-slider {
  box-shadow: 0 0 0 2px rgb(255 187 0 / 20%);
}

/* 错误消息 */
.error-message {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .content_p {
    padding: 30px 20px 0px 20px;
  }


  .items-grid {
    grid-template-columns: 1fr;
  }

  .summary-content {
    flex-direction: column;
    text-align: center;
    align-items: normal;
  }

  .btn-primary,
  .btn-secondary {
    width: 50%;
  }

  .price-container {
    text-align: center;
  }

  .original-price {
    float: none;
  }
}