/* =============================================================================
 * 诗词文/名句 多模态国风分享组件样式 (share.css)
 * 适配移动端与PC端，支持海报图片与多套排版文字实时预览与一键复制/下载
 * ============================================================================= */

/* 顶部/行内操作区分享按钮微调 */
.btn-share {
  background: linear-gradient(135deg, var(--theme-primary, #6b2836) 0%, #873647 100%);
  color: #fff !important;
  border-color: transparent !important;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(107, 40, 54, 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-share:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(107, 40, 54, 0.28);
}
.btn-share .share-icon {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
}

/* 遮罩层 */
.gs-share-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 10, 12, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Serif SC", SimSun, serif;
}
.gs-share-modal-mask.show {
  opacity: 1;
  visibility: visible;
}

/* 弹窗主体容器 */
.gs-share-modal {
  background: #fbf9f5;
  background-image: radial-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 0);
  background-size: 12px 12px;
  border: 1px solid #e2d9cd;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #2b231d;
}
.gs-share-modal-mask.show .gs-share-modal {
  transform: scale(1) translateY(0);
}

/* 弹窗头部 */
.gs-share-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee5d8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f2ea;
}
.gs-share-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gs-share-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 12px;
  border-radius: 4px;
  background: #6b2836;
  color: #fff;
  font-family: "Noto Serif SC", SimSun, serif;
  letter-spacing: 1px;
}
.gs-share-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: #2d1a20;
  letter-spacing: 0.5px;
}
.gs-share-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #8c7f70;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}
.gs-share-close:hover {
  color: #2d1a20;
  background: rgba(0, 0, 0, 0.05);
}

/* 顶部标签页切换（分享图片 / 分享文字） */
.gs-share-tabs {
  display: flex;
  padding: 0 20px;
  background: #f7f2ea;
  border-bottom: 1px solid #e7ded0;
  gap: 8px;
}
.gs-share-tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #7b6e5d;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gs-share-tab-btn:hover {
  color: #4a212b;
}
.gs-share-tab-btn.active {
  color: #6b2836;
}
.gs-share-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #6b2836;
  border-radius: 2px 2px 0 0;
}

/* 内容主区域 */
.gs-share-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 280px;
}

/* 模板选择药丸标签组 */
.gs-tpl-selector {
  margin-bottom: 14px;
}
.gs-tpl-label {
  font-size: 12px;
  color: #8a7a67;
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}
.gs-tpl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gs-tpl-pill {
  border: 1px solid #ded5c7;
  background: #fff;
  color: #554839;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gs-tpl-pill:hover {
  border-color: #b59b7d;
  color: #2b231d;
  background: #fbf9f4;
}
.gs-tpl-pill.active {
  background: #6b2836;
  color: #fff;
  border-color: #6b2836;
  box-shadow: 0 2px 6px rgba(107, 40, 54, 0.25);
  font-weight: 500;
}
.gs-tpl-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* 图片预览卡片展示区 */
.gs-share-preview-card {
  background: #efe9df;
  border: 1px dashed #d5c8b5;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  max-height: 540px;
  overflow-y: auto;
  margin-bottom: 14px;
  position: relative;
}
.gs-share-canvas-container {
  max-width: 100%;
  display: flex;
  justify-content: center;
}
.gs-share-canvas-container canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: #fff;
}

/* 文本预览容器 */
.gs-text-preview-wrap {
  border: 1px solid #e2d7c5;
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03) inset;
}
.gs-text-preview {
  width: 100%;
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  border: none;
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: #2f251c;
  white-space: pre-wrap;
  word-break: break-all;
  background: transparent;
}

/* 底部操作条 */
.gs-share-footer {
  padding: 14px 20px;
  border-top: 1px solid #eee5d8;
  background: #f7f2ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gs-share-tip {
  font-size: 12px;
  color: #8a7a67;
  flex: 1;
}
.gs-share-actions {
  display: flex;
  gap: 10px;
}
.gs-btn {
  padding: 8px 16px;
  font-size: 13.5px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 500;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gs-btn-secondary {
  background: #fff;
  border-color: #d6cbbe;
  color: #4b3e30;
}
.gs-btn-secondary:hover {
  background: #f4ede3;
  border-color: #c0b3a3;
  color: #2b231d;
}
.gs-btn-primary {
  background: #6b2836;
  color: #fff;
  border-color: #6b2836;
  box-shadow: 0 2px 6px rgba(107, 40, 54, 0.2);
}
.gs-btn-primary:hover {
  background: #7d3040;
  box-shadow: 0 3px 8px rgba(107, 40, 54, 0.3);
}

/* 复制成功轻提示 (Toast) */
.gs-share-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(35, 23, 27, 0.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}
.gs-share-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 移动端响应式微调 */
@media (max-width: 600px) {
  .gs-share-modal {
    max-height: 94vh;
  }
  .gs-share-header {
    padding: 12px 14px;
  }
  .gs-share-tabs {
    padding: 0 14px;
  }
  .gs-share-body {
    padding: 12px 14px;
  }
  .gs-share-footer {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
  }
  .gs-share-actions {
    width: 100%;
  }
  .gs-share-actions .gs-btn {
    flex: 1;
    justify-content: center;
  }
  .gs-share-canvas-container canvas {
    max-height: 280px;
  }
}
