/* u_7.html 专用样式 - 图片布局 */

/* 图片网格容器 */
.mc-media-grid {
  display: grid;
  gap: 4px;
  /* 图片间距 */
  width: 100%;
  margin-bottom: 12px;
  border-radius: 8px;
  /* 整体圆角 */
  overflow: hidden;
  /* 确保圆角生效 */
  position: relative;
}

/* 1张图：保持原有比例或自适应 */
.mc-media-grid.grid-1 {
  grid-template-columns: 1fr;
}

.mc-media-grid.grid-1 .mc-image {
  width: 100%;
  height: auto;
  /* 移除固定比例，显示原始比例 */
}

/* 2张图：1排2个 */
.mc-media-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.mc-media-grid.grid-2 .mc-image {
  width: 100%;
  aspect-ratio: 1/1;
  /* 正方形 */
  object-fit: cover;
}

/* 3张图：1排3个 */
.mc-media-grid.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.mc-media-grid.grid-3 .mc-image {
  width: 100%;
  aspect-ratio: 1/1;
  /* 正方形 */
  object-fit: cover;
}

/* 4张图：2排2个 */
.mc-media-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.mc-media-grid.grid-4 .mc-image {
  width: 100%;
  aspect-ratio: 1/1;
  /* 正方形 */
  object-fit: cover;
}

/* 统计标签样式调整 */
.mc-counts {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 4px 8px;
  display: flex;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  pointer-events: none;
  /* 防止遮挡点击 */
}

.mc-counts span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mc-counts img {
  width: 12px;
  height: 12px;
}

.ddd1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.mc-more-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #CFCDE4;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.mc-more-btn:active {
  opacity: 1;
}

/* 瀑布流布局 - 宽度大于 700px 时 */
@media (min-width: 700px) {
  .melon-grid {
    /*display: block;*/
    /* 覆盖 grid */
    column-count: 2;
    column-gap: 50px;
    max-width: 720px;
    margin: 0 auto;
    grid-template-columns: repeat(1, 1fr);
  }

  .melon-grid .melon-card {
    break-inside: avoid;
    /* 防止卡片在列间断裂 */
    margin-bottom: 24px;
    /* 垂直间距 */
    /* 确保占满列宽 */
    display: inline-block;
    /* 关键修复：防止内容重叠 */
  }
}

/* 悬浮按钮样式 */
.floating-buttons {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1000;
}

.float-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.3s;
  color: #5b75a6;
}

.float-btn:active {
  transform: scale(0.95);
}

/* 顶部按钮默认隐藏 */
#scrollTopBtn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

#scrollTopBtn.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* 发布按钮样式 - 渐变背景 */
.float-btn.primary {
  background: -webkit-linear-gradient(left, #8533ED, #008EFE);
  color: white;
}

/* 新增发布弹窗样式 */
#publishModal {
  z-index: 9999 !important;
  /* 确保在最上层 */
}

.publish-modal {
  background: var(--nav-bg-primary, #212536) !important;
  padding: 20px !important;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pm-header {
  margin-bottom: 5px !important;
  border-bottom: none !important;
}

.pm-title {
  color: white !important;
  font-weight: bold;
}

.pm-close img {
  /* filter: brightness(0) invert(1); */
  /* 移除反色滤镜，保持原图标颜色 */
}

.pm-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pm-card {
  background: var(--nav-bg-secondary, #282c40);
  /* backdrop-filter: blur(10px); */
  border-radius: 12px;
  padding: 15px;
  border: 1px solid var(--nav-border-color, rgba(207, 205, 228, 0.1));
  color: var(--nav-text-primary, #CFCDE4);
}

/* 文本输入卡片 */
.text-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pm-textarea-modern {
  width: 100%;
  height: 140px;
  background: transparent;
  border: none;
  color: var(--nav-text-primary, #CFCDE4);
  font-size: 16px;
  resize: none;
  outline: none;
}

.pm-textarea-modern::placeholder {
  color: var(--nav-text-secondary, #8C8EA6);
}

.pm-counter-modern {
  position: absolute;
  bottom: 12px;
  right: 15px;
  font-size: 12px;
  color: var(--nav-text-secondary, #8C8EA6);
}

/* 图片上传卡片 */
.pm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.pm-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}

.pm-icon-small {
  width: 16px;
  height: 16px;
  opacity: 0.9;
  /* filter: brightness(0) invert(1); */
}

.pm-card-count {
  font-size: 12px;
  color: var(--nav-text-secondary, #8C8EA6);
}

.pm-image-grid-modern {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-add-image-btn-modern {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nav-border-color, rgba(207, 205, 228, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nav-text-primary, #CFCDE4);
  cursor: pointer;
  transition: background 0.2s;
}

.pm-add-image-btn-modern:active {
  background: rgba(255, 255, 255, 0.1);
}

/* 设置卡片 */
.pm-setting-header {
  font-size: 13px;
  color: var(--nav-text-secondary, #8C8EA6);
  margin-bottom: 12px;
}

.pm-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pm-setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.pm-setting-value {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--nav-text-primary, #CFCDE4);
  cursor: pointer;
}

.arrow-down {
  font-size: 10px;
  opacity: 0.8;
}

/* 可见性下拉菜单样式 */
.pm-setting-value {
  position: relative;
  /* 确保下拉菜单相对于此元素定位 */
}

.visibility-dropdown {
  position: absolute;
  bottom: 100%;
  /* 显示在上方 */
  right: 0;
  width: 120px;
  background: var(--nav-bg-secondary, #282c40);
  border: 1px solid var(--nav-border-color, rgba(207, 205, 228, 0.1));
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 5px 0;
  z-index: 10;
  display: none;
  /* 默认隐藏 */
  margin-bottom: 5px;
}

.visibility-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.visibility-option {
  padding: 10px 15px;
  color: var(--nav-text-primary, #CFCDE4);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.visibility-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.visibility-option.active {
  color: #008EFE;
  /* 选中状态颜色 */
  font-weight: 500;
}

/* 提交按钮调整 */
.pm-submit {
  margin-top: 10px !important;
  background: linear-gradient(90deg, #8533ED, #008EFE) !important;
  color: white !important;
  border: none !important;
  height: 44px !important;
  border-radius: 22px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}