/**
 * 前台授权产品列表 —— 对齐 MikaLicenseProducts，并跟随 mkua 主题深/浅色
 */
.mlm-license-products {
  display: grid;
  gap: 20px;
  width: 100%;
  padding: 32px 0 48px;
  box-sizing: border-box;

  /* 优先用主题变量；无主题变量时浅色兜底 */
  --c-text: var(--color-text-primary, var(--mk-text-primary, #0f172a));
  --c-muted: var(--color-text-regular, var(--mk-text-tertiary, #64748b));
  --c-muted-2: var(--color-text-secondary, var(--mk-text-muted, #94a3b8));
  --c-border: var(--border-color-base, var(--mk-border, #e2e8f0));
  --c-border-strong: var(--border-color-base, var(--mk-border-strong, #cbd5e1));
  --c-accent: var(--color-primary, var(--theme-color, var(--mk-brand-primary, #4f46e5)));
  --c-accent-dark: var(--color-primary-end, var(--mk-brand-primary-hover, #4338ca));
  --c-accent-soft: var(--bg-text-color, var(--mk-brand-soft, #eef2ff));
  --c-surface: var(--bg-main-color, var(--mk-bg-surface, #ffffff));
  --c-surface-2: var(--bg-muted-color, var(--bg-surface-color, var(--mk-bg-surface-2, #f8fafc)));
  --c-on-brand: var(--color-white, var(--mk-text-on-brand, #ffffff));
  --c-link: var(--color-primary, var(--mk-link-text, #2563eb));
  --c-warning: var(--mk-warning, #f59e0b);
  --c-shadow: rgba(15, 23, 42, 0.08);
  --c-shadow-hover: rgba(15, 23, 42, 0.22);
}

/* 深色主题：强制用站点暗色板，避免任何浅色回退 */
html.dark-theme .mlm-license-products,
body.dark-theme .mlm-license-products,
.dark-theme .mlm-license-products {
  --c-text: var(--color-text-primary, #ffffff);
  --c-muted: var(--color-text-regular, #a0a0b0);
  --c-muted-2: var(--color-text-secondary, #808098);
  --c-border: var(--border-color-base, #3b3b54);
  --c-border-strong: var(--border-color-base, #3b3b54);
  --c-accent: var(--color-primary, var(--theme-color, #7c5cfc));
  --c-accent-dark: var(--color-primary-end, #b49aff);
  --c-accent-soft: rgba(124, 92, 252, 0.16);
  --c-surface: var(--bg-main-color, #252538);
  --c-surface-2: var(--bg-muted-color, #1a1a28);
  --c-on-brand: #ffffff;
  --c-link: var(--color-primary, #7c5cfc);
  --c-warning: #f59e0b;
  --c-shadow: rgba(0, 0, 0, 0.35);
  --c-shadow-hover: rgba(0, 0, 0, 0.55);
}

.mlm-license-products .lp-head h1,
.mlm-license-products .lp-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.01em;
}

.mlm-license-products .lp-state {
  border: 1px dashed var(--c-border-strong);
  border-radius: 14px;
  background: var(--c-surface);
  padding: 36px 20px;
  color: var(--c-muted);
  text-align: center;
}

.mlm-license-products .lp-grid {
  display: grid;
  gap: 18px;
  align-items: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.mlm-license-products .lp-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: 16px;
  background: var(--c-surface);
  box-shadow: 0 1px 3px var(--c-shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.mlm-license-products .lp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -16px var(--c-shadow-hover);
  border-color: var(--c-border-strong);
}

.mlm-license-products .lp-card-cover-link {
  display: block;
  text-decoration: none;
}

.mlm-license-products .lp-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--c-surface-2);
}

.mlm-license-products .lp-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.mlm-license-products .lp-card:hover .lp-card-cover {
  transform: scale(1.04);
}

.mlm-license-products .lp-card-cover-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--c-muted-2);
  font-size: 13px;
}

.mlm-license-products .lp-ribbon {
  position: absolute;
  top: 12px;
  left: -32px;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, var(--c-warning), #d97706);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 36px;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

.mlm-license-products .lp-verified {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-link);
  color: var(--c-on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--c-link) 40%, transparent);
}

.mlm-license-products .lp-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 18px;
  min-height: 0;
}

.mlm-license-products .lp-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mlm-license-products .lp-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-weight: 500;
}

.mlm-license-products .lp-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--c-text);
}

.mlm-license-products .lp-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.mlm-license-products .lp-title-link:hover {
  color: var(--c-accent);
}

.mlm-license-products .lp-subtitle,
.mlm-license-products .lp-summary {
  margin: 0;
  line-height: 1.65;
  color: var(--c-muted);
  font-size: 13.5px;
}

.mlm-license-products .lp-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mlm-license-products .lp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  background: var(--c-surface-2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--c-muted);
}

.mlm-license-products .lp-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mlm-license-products .lp-stat-val {
  color: var(--c-text);
  font-weight: 600;
}

.mlm-license-products .lp-stat-label {
  color: var(--c-muted-2);
}

.mlm-license-products .lp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--c-border);
}

.mlm-license-products .lp-price-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.mlm-license-products .lp-price-from {
  font-size: 12px;
  color: var(--c-muted);
}

.mlm-license-products .lp-currency {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-right: 1px;
}

.mlm-license-products .lp-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.mlm-license-products .lp-price-original {
  font-size: 12px;
  color: var(--c-muted-2);
  text-decoration: line-through;
}

.mlm-license-products .lp-price-text {
  font-size: 14px;
  color: var(--c-muted);
}

.mlm-license-products .lp-detail-btn,
.mlm-license-products a.lp-detail-btn,
.mlm-license-products a.lp-detail-btn:hover,
.mlm-license-products a.lp-detail-btn:focus,
.mlm-license-products a.lp-detail-btn:active,
.mlm-license-products a.lp-detail-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--c-accent) 55%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  opacity: 1;
}

.mlm-license-products a.lp-detail-btn:hover,
.mlm-license-products a.lp-detail-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px -8px color-mix(in srgb, var(--c-accent) 65%, transparent);
  color: #fff !important;
  filter: brightness(1.06);
}

@media (max-width: 920px) {
  .mlm-license-products .lp-grid {
    grid-template-columns: 1fr;
  }
}
