/* ============================================================
 * content-pages.css — 独立内容页面样式
 * 包含：发布页、产品管理页、社交账号管理页
 * ============================================================ */

/* === 全屏覆盖层 === */
.cp-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #f5f6fa;
  z-index: 9998;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: cp-fadeIn 0.2s ease;
}

@keyframes cp-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === 通用页面头部 === */
.cp-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #eeeff3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.cp-header .cp-back {
  display: flex; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: #1a1a2e; padding: 6px 4px;
  font-weight: 500;
}
.cp-header .cp-title {
  font-size: 17px; font-weight: 600; color: #1a1a2e;
}
.cp-header .cp-action {
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: #e94560; font-weight: 500;
  padding: 6px 10px;
}

/* === 通用页面容器 === */
.cp-page {
  max-width: 500px;
  margin: 0 auto;
  padding: 12px 14px 40px;
}

/* === Tab 栏 === */
.cp-tabs {
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
  gap: 4px;
}
.cp-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 14px;
  color: #666;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.cp-tab.active {
  background: #1a1a2e;
  color: #fff;
}

/* === 分段控制器 Tab === */
.cp-seg-tabs {
  display: flex;
  background: #eceef1;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
  gap: 2px;
}
.cp-seg-tab {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  font-size: 13px;
  color: #888;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.cp-seg-tab.active {
  background: #fff;
  color: #1a1a2e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* === 编辑器卡片（标题+正文+工具栏） === */
.cp-editor-card {
  padding: 14px 16px 0;
}
.cp-editor-title {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid #f0f1f5;
  padding: 0 0 10px 0;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a2e;
  background: transparent;
  outline: none;
}
.cp-editor-title::placeholder { color: #ccc; }
.cp-editor-body {
  width: 100%;
  box-sizing: border-box;
  border: none;
  padding: 12px 0;
  font-size: 14px;
  color: #1a1a2e;
  background: transparent;
  outline: none;
  resize: none;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.7;
}
.cp-editor-body::placeholder { color: #ccc; }

/* === 内联配图 === */
.cp-inline-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

/* === 链接输入行 === */
.cp-link-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.cp-link-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #1a1a2e;
  font-family: inherit;
}
.cp-link-input::placeholder { color: #bbb; }
.cp-link-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  padding: 2px 4px;
}

/* === 底部工具栏 === */
.cp-toolbar {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid #f0f1f5;
}
.cp-tool-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #888;
  padding: 4px 0;
  font-family: inherit;
  transition: color 0.15s;
}
.cp-tool-btn.active { color: #185fa5; font-weight: 500; }
.cp-tool-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: #185fa5;
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  padding: 0 4px;
}

/* === 封面图卡片 === */
.cp-cover-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.cp-cover-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp-cover-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f7f8fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #999;
  flex-shrink: 0;
}
.cp-cover-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cp-cover-label {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a2e;
}
.cp-cover-hint {
  font-size: 12px;
  color: #bbb;
}
.cp-cover-action {
  flex-shrink: 0;
}
.cp-cover-btn {
  width: 48px;
  height: 36px;
  border-radius: 8px;
  border: 1px dashed #d0d1d6;
  background: #fafbfc;
  font-size: 20px;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cp-cover-btn-del {
  border: none;
  background: rgba(0,0,0,0.05);
  color: #e94560;
  font-size: 14px;
}

/* === 高级选项卡片 === */
.cp-advanced-card {
  padding: 0 16px;
  overflow: hidden;
}
.cp-advanced-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  cursor: pointer;
}
.cp-advanced-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
}
.cp-advanced-hint {
  flex: 1;
  font-size: 12px;
  color: #bbb;
}
.cp-advanced-arrow {
  color: #ccc;
  transition: transform 0.2s;
}
.cp-advanced-arrow.open {
  transform: rotate(180deg);
}
.cp-advanced-body {
  padding-bottom: 14px;
  border-top: 1px solid #f0f1f5;
  padding-top: 14px;
}
.cp-adv-section {
  margin-bottom: 14px;
}
.cp-adv-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
  font-weight: 500;
}
.cp-advanced-body .cp-card {
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
  background: transparent;
}
.cp-advanced-body .cp-card-title {
  font-size: 13px;
  color: #888;
  font-weight: 500;
  margin-bottom: 8px;
}
.cp-advanced-body .cp-reward-section {
  background: transparent;
  padding: 0;
}

/* === 表单卡片 === */
.cp-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cp-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 12px;
}

/* === 表单元素 === */
.cp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid #e8e9ee;
  border-radius: 10px;
  font-size: 15px;
  color: #1a1a2e;
  background: #fafbfc;
  outline: none;
  transition: border-color 0.15s;
}
.cp-input:focus {
  border-color: #1a1a2e;
  background: #fff;
}
.cp-input::placeholder { color: #bbb; }

.cp-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid #e8e9ee;
  border-radius: 10px;
  font-size: 15px;
  color: #1a1a2e;
  background: #fafbfc;
  outline: none;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.cp-textarea:focus {
  border-color: #1a1a2e;
  background: #fff;
}
.cp-textarea::placeholder { color: #bbb; }

.cp-label {
  display: block;
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
  font-weight: 500;
}
.cp-label .cp-required { color: #e94560; }

.cp-field { margin-bottom: 14px; }
.cp-field:last-child { margin-bottom: 0; }

/* === 图片上传 === */
.cp-upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d8d9de;
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
  position: relative;
}
.cp-upload-zone:hover { border-color: #1a1a2e; }
.cp-upload-zone img {
  width: 100%; height: 100%; object-fit: cover;
}
.cp-upload-text {
  font-size: 14px; color: #999; padding: 24px;
}

.cp-img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.cp-img-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
}
.cp-img-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.cp-img-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff; border: none;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.cp-img-add {
  aspect-ratio: 1;
  border: 2px dashed #d8d9de;
  border-radius: 8px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #ccc;
  cursor: pointer;
}

.cp-cover-preview {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cp-cover-preview img {
  width: 100%;
  display: block;
  border-radius: 10px;
}
.cp-cover-del {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff; border: none;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* === 标签选择 === */
.cp-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-tag-btn {
  padding: 6px 14px;
  border: 1.5px solid #e8e9ee;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}
.cp-tag-btn.active {
  border-color: #1a1a2e;
  background: #1a1a2e;
  color: #fff;
}

/* === 底部操作栏 === */
.cp-bottom-bar {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-top: 1px solid #eeeff3;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.cp-btn {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  text-align: center;
}
.cp-btn:active { opacity: 0.8; }
.cp-btn-primary {
  background: #1a1a2e;
  color: #fff;
}
.cp-btn-secondary {
  background: #f0f1f5;
  color: #666;
}
.cp-btn-danger {
  background: #e94560;
  color: #fff;
}

/* === 成功页面 === */
.cp-success {
  text-align: center;
  padding: 40px 20px;
}
.cp-success-icon {
  font-size: 56px;
  margin-bottom: 12px;
}
.cp-success-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 8px;
}
.cp-success-desc {
  font-size: 14px;
  color: #999;
  margin: 0 0 24px;
}
.cp-success-preview {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
  text-align: left;
  align-items: center;
}
.cp-success-thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.cp-success-info { flex: 1; min-width: 0; }
.cp-success-info h4 {
  font-size: 15px; font-weight: 600; color: #1a1a2e;
  margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-success-info p {
  font-size: 13px; color: #999; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-success-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #f0f1f5;
  border-radius: 10px;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.cp-success-actions {
  display: flex;
  gap: 10px;
}

/* === 产品/社交列表项 === */
.cp-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cp-list-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #f0f1f5;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cp-list-body {
  flex: 1; min-width: 0;
}
.cp-list-name {
  font-size: 15px; font-weight: 600; color: #1a1a2e;
  margin: 0 0 4px;
}
.cp-list-desc {
  font-size: 13px; color: #888;
  margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-list-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cp-list-btn {
  padding: 5px 12px;
  border: 1.5px solid #e8e9ee;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}
.cp-list-btn:hover { border-color: #1a1a2e; color: #1a1a2e; }
.cp-list-btn.danger { color: #e94560; border-color: #ffcdd2; }
.cp-list-btn.danger:hover { background: #fff5f5; }

/* === 空状态 === */
.cp-empty {
  text-align: center;
  padding: 60px 20px;
}
.cp-empty-icon { font-size: 48px; margin-bottom: 12px; }
.cp-empty-text { font-size: 15px; color: #999; margin: 0 0 16px; }
.cp-empty-btn {
  display: inline-block;
  padding: 10px 24px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

/* === 弹窗 === */
.cp-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cp-fadeIn 0.15s ease;
}
.cp-modal {
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  animation: cp-slideUp 0.2s ease;
}
@keyframes cp-slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.cp-modal-title {
  font-size: 17px; font-weight: 600; color: #1a1a2e;
  margin: 0 0 16px; text-align: center;
}
.cp-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* === 首页区块编辑按钮 === */
.cp-section-edit-btn {
  font-size: 13px;
  color: #e94560;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 8px;
}

/* === Toast === */
.cp-toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 10000;
  pointer-events: none;
  animation: cp-fadeIn 0.15s ease;
}

/* === 工具行 === */
.cp-toolrow {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f0f1f5;
  margin-top: 10px;
}
.cp-toolitem {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #999;
  cursor: pointer;
}
.cp-toolitem.active { color: #1a1a2e; font-weight: 500; }

/* === 奖励设置 === */
.cp-reward-section {
  background: #fafbfc;
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
}
.cp-reward-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cp-reward-row:last-child { margin-bottom: 0; }
.cp-reward-label { font-size: 13px; color: #666; }
.cp-reward-tabs {
  display: flex;
  gap: 6px;
}
.cp-reward-tab {
  padding: 4px 12px;
  border: 1.5px solid #e8e9ee;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}
.cp-reward-tab.active {
  border-color: #1a1a2e;
  background: #1a1a2e;
  color: #fff;
}
.cp-reward-input {
  width: 80px;
  padding: 4px 8px;
  border: 1.5px solid #e8e9ee;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  outline: none;
}
.cp-reward-input:focus { border-color: #1a1a2e; }

/* === 地区选择弹窗 === */
.cp-region-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: cp-fadeIn 0.15s ease;
}
.cp-region-sheet {
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: cp-slideUp 0.2s ease;
}
.cp-region-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border-bottom: 1px solid #f0f1f5;
}
.cp-region-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
}
.cp-region-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.cp-region-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f1f5;
}
.cp-region-search-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  color: #1a1a2e;
  font-family: inherit;
}
.cp-region-search-input::placeholder { color: #bbb; }
.cp-region-body {
  overflow-y: auto;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.cp-region-group {
  margin-bottom: 16px;
}
.cp-region-group-title {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
  font-weight: 500;
}
.cp-region-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-region-item {
  padding: 8px 14px;
  border: 1.5px solid #e8e9ee;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.cp-region-item.active {
  border-color: #1a1a2e;
  background: #1a1a2e;
  color: #fff;
}
.cp-region-empty {
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  color: #999;
}

/* 推广范围行可点击 */
.cp-reward-region-row {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cp-region-value {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* === 隐藏 CardEdit 中已提取的模块 === */
.card-edit-page .editor-weizan,
.card-edit-page .ce-products-section,
.card-edit-page .ce-socials-section {
  display: none !important;
}
