/* Size Guide：触发器 + 弹窗 */

/* 触发器钉在标签行右侧。
   advertising-template2-component 是自定义元素，默认 display:inline —— 
   不给它 block + relative，绝对定位就会跑到更外层的祖先上去。 */
advertising-template2-component {
  display: block;
  position: relative;
}

.pp-sg-trigger {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}

.pp-sg-trigger:hover {
  opacity: 0.6;
}

.pp-sg-icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

/* ---- 弹窗 ---- */
.pp-sg-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pp-sg-modal[data-open="true"] {
  display: flex;
}

.pp-sg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pp-sg-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.pp-sg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.pp-sg-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.pp-sg-close {
  display: inline-flex;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: #6e6e73;
  border-radius: 50%;
  transition: background-color 0.15s ease;
}

.pp-sg-close:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.pp-sg-close svg {
  width: 18px;
  height: 18px;
}

.pp-sg-body {
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.016em;
  color: #1d1d1f;
}

/* 元字段里多半是尺码表 —— 窄屏放不下时让它自己横向滚，
   而不是把整个弹窗撑破 */
.pp-sg-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.pp-sg-body th,
.pp-sg-body td {
  border: 1px solid #e5e5e7;
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}

.pp-sg-body th {
  background: #f5f5f7;
  font-weight: 600;
}

.pp-sg-body img {
  max-width: 100%;
  height: auto;
}

@media screen and (max-width: 768px) {
  .pp-sg-trigger {
    font-size: 13px;
  }
  .pp-sg-panel {
    padding: 18px;
    max-height: 85vh;
  }
  .pp-sg-title {
    font-size: 17px;
  }
}
