/* Completion Zone — kw-to-kva 金样板布局与视觉权重 */

.completion-zone {
  margin: 1.25rem 0 1.5rem;
  max-width: 100%;
}

.completion-zone__grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

.completion-zone[data-layout="split"] .completion-zone__grid {
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
}

.completion-zone__next-action {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.completion-zone[data-layout="split"] .completion-zone__next-action {
  flex: 1 1 62%;
}

.completion-zone__commercial {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.completion-zone[data-layout="split"] .completion-zone__commercial {
  flex: 0 0 38%;
  max-width: 336px;
}

.completion-zone__next-action .intent-recommendation,
.completion-zone__next-action .result-actions-bar {
  margin-bottom: 0.75rem;
}

.completion-zone__next-action .result-actions-bar:last-child {
  margin-bottom: 0;
}

/* Sponsored strip — visually distinct from workflow / action cards */
.commercial-panel--sponsored {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0 0.75rem;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
  border-radius: 0;
  box-shadow: none;
  max-width: 100%;
  box-sizing: border-box;
}

.commercial-panel__label {
  margin: 0 0 0.4rem;
  padding: 0 0.15rem;
  font-size: 0.6875rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 600;
}

.commercial-panel__frame {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #eef2f6;
  padding: 0.35rem 0.5rem;
  overflow: hidden;
}

.commercial-panel__mount {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  border-radius: 4px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  overflow: hidden;
}

.commercial-panel__mount--active {
  border-style: solid;
  border-color: #cbd5e1;
  background: #fff;
}

.commercial-panel__mount--banner-mobile {
  display: block;
  width: 100%;
  max-width: 320px;
  min-height: 50px;
  height: 50px;
  max-height: 50px;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  position: relative;
  contain: none;
}

.commercial-panel__mount--banner-mobile.commercial-panel__mount--active {
  border: none;
  background: transparent;
}

.commercial-panel__mount--banner-mobile .adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 320px !important;
  height: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  margin: 0 auto;
  overflow: hidden !important;
}

.commercial-panel__mount--banner-mobile iframe {
  display: block !important;
  width: 100% !important;
  max-width: 320px !important;
  height: 50px !important;
  max-height: 50px !important;
  margin: 0 auto;
}

.commercial-panel__mount--banner-desktop {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 90px;
  height: 90px;
  max-height: 90px;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.commercial-panel__mount--banner-desktop.commercial-panel__mount--active {
  border: none;
  background: transparent;
}

.commercial-panel__mount--banner-desktop .adsbygoogle {
  display: inline-block !important;
  width: 728px !important;
  height: 90px !important;
  max-width: 100%;
}

.commercial-panel__mount:empty {
  min-height: 0;
  height: auto;
  max-height: none;
  border: none;
  background: transparent;
}

.commercial-panel__frame:has(.commercial-panel__mount:empty) {
  display: none;
}

.commercial-panel--sponsored:has(.commercial-panel__mount:empty) {
  display: none;
}

.commercial-panel--sponsored[data-mobile-ad-rejected] {
  display: none !important;
}

.commercial-panel--sponsored[data-mobile-ad-ready="1"] .commercial-panel__mount--banner-mobile {
  border: none;
  background: #fff;
}

@media (max-width: 768px) {
  .completion-zone,
  .completion-zone__grid,
  .completion-zone__next-action,
  .completion-zone__commercial {
    overflow-x: clip;
  }

  .completion-zone[data-layout="split"] .completion-zone__grid {
    flex-direction: column;
  }

  .completion-zone[data-layout="split"] .completion-zone__commercial {
    max-width: 100%;
  }

  /* 手机：视口内 50px 槽位加载（AdSense 需可见区域才易出 iframe 横幅） */
  .commercial-panel--sponsored[data-mobile-ad-ready="1"] {
    margin: 0.35rem 0 0.65rem;
    padding: 0.5rem 0 0.35rem;
    width: 100%;
    max-width: 100%;
    background: #f1f5f9;
    overflow: hidden;
    isolation: isolate;
  }

  .commercial-panel--sponsored:not([data-mobile-ad-ready="1"]) {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
  }

  .commercial-panel__label {
    text-align: center;
    margin-bottom: 0.35rem;
    padding: 0;
  }

  .commercial-panel__frame {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }

  .commercial-panel__mount--banner-mobile {
    width: 100%;
    max-width: min(100%, 320px);
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    overflow: hidden;
  }
}
