/* ============================================================
 * 阶段7 滴滴严选（公域联盟昌平）— 商品比价+领券引导
 * 配套：portal-stage7.js（拉商品/领券流程）
 * 版本：v=0903d1
 *
 * 设计原则（与 portal-stage4.css 一致 — 工具栏风格）：
 *   - 视觉退后（公域联盟非主项）
 *   - 浅灰底 + 细边框 + 小图标
 *   - 桌面 4 列 / 平板 2 列 / 手机 1 列
 *   - 微信 X5 兼容：触摸目标 ≥44px、最小字号 12px
 * ============================================================ */

/* 滴滴严选主容器 */
.stage7-didi {
  margin: 24px 0;
  padding: 0 16px;
}

/* 区头（与 portal-stage4 共用样式对齐） */
.stage7-didi .stage7-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.stage7-didi .stage7-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage7-didi .stage7-section-sub {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}

.stage7-didi .stage7-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 500;
}

/* 商品列表 grid */
.stage7-didi-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stage7-didi-card {
  background: #f8fafc; /* 浅灰底 — 与现有公域联盟风格一致 */
  border: 0.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .2s;
  cursor: pointer;
  min-height: 88px;
}

.stage7-didi-card:hover {
  background: #fff;
  border-color: var(--brand, #4f46e5);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .12);
  transform: translateY(-1px);
}

.stage7-didi-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage7-didi-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 0.5px solid #e5e7eb;
}

.stage7-didi-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
  line-height: 1.3;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage7-didi-card-desc {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 30px;
}

.stage7-didi-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.stage7-didi-card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand, #4f46e5);
}

.stage7-didi-card-price-unit {
  font-size: 10px;
  color: var(--text-muted, #6b7280);
  font-weight: 400;
  margin-left: 2px;
}

.stage7-didi-card-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--brand, #4f46e5);
  color: #fff;
  border: none;
  cursor: pointer;
  min-height: 28px; /* 微信触控目标 */
  transition: opacity .15s;
}

.stage7-didi-card-btn:hover { opacity: .85; }
.stage7-didi-card-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* 加载中/空状态 */
.stage7-didi-loading,
.stage7-didi-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted, #6b7280);
  font-size: 13px;
}

.stage7-didi-loading::before {
  content: '🌀';
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
  animation: stage7-spin 1.2s linear infinite;
}

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

/* 响应式 */
@media (max-width: 1024px) {
  .stage7-didi-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .stage7-didi-list { grid-template-columns: 1fr; }
  .stage7-didi-card { min-height: 76px; }
}

/* ============================================================================
 * 滴滴券码弹窗（用户点"领券"显示）
 * 风格：复用 epay.hainankumeng.cn 内页弹窗的紫蓝色调
 * ============================================================================ */
.stage7-coupon-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}

.stage7-coupon-modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: stage7-pop .25s ease-out;
}

@keyframes stage7-pop {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.stage7-coupon-modal h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage7-coupon-modal .desc {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  line-height: 1.6;
  margin-bottom: 16px;
}

.stage7-coupon-pwd-box {
  background: linear-gradient(135deg, var(--brand, #4f46e5), var(--accent, #0ea5e9));
  color: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}

.stage7-coupon-pwd-box .label {
  font-size: 12px;
  opacity: .9;
  margin-bottom: 4px;
}

.stage7-coupon-pwd-box .pwd {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: "SF Mono", Consolas, monospace;
  word-break: break-all;
  user-select: all;
}

.stage7-coupon-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.stage7-coupon-actions button {
  flex: 1;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  border: none;
  transition: opacity .15s;
}

.stage7-coupon-actions .copy-btn {
  background: var(--brand, #4f46e5);
  color: #fff;
}

.stage7-coupon-actions .close-btn {
  background: #f1f5f9;
  color: var(--text-primary, #1f2937);
}

.stage7-coupon-actions button:hover { opacity: .85; }

/* 提示步骤（引导用户去滴滴App核销） */
.stage7-coupon-steps {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.stage7-coupon-steps .step {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  padding: 4px 0;
  line-height: 1.5;
}

.stage7-coupon-steps .step-num {
  background: var(--brand, #4f46e5);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 错误状态 */
.stage7-didi-error {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  text-align: center;
  grid-column: 1 / -1;
}
