.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.tag {
    padding: 6px 12px;
    background-color: #1a1a1a;
    border-radius: 20px;
    font-size: 12px;
    color: #cccccc;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #2a2a2a;
}

.tag.selected {
    background-color: #ffffff;
    color: #0a0a0a;
}

/* 瀑布流布局样式 - 用户提供的效果 */
.gallery {
  /* 定义列数（响应式可配合媒体查询调整） */
  column-count: 5;
  /* 列间距 */
  column-gap: 15px;
  margin: 0 auto;
}

.gallery-item {
  /* 防止图片被列分割 */
  break-inside: avoid;
  margin-bottom: 15px;
  transition: transform 0.2s;
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: block;
}

/* 隐藏视频控件 */
.gallery-video::-webkit-media-controls {
  display: none;
}

.gallery-video {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none; /* 防止用户点击视频 */
}

/* 半透明遮罩层样式 */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* 旋转动画样式 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式适配：小屏幕减少列数 */
@media (max-width: 1280px) {
  .gallery {
    column-count: 4;
  }
}
@media (max-width: 768px) {
  .gallery {
    column-count: 3;
  }
  
  /* 其他响应式样式 */
  .header {
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-gallery {
    flex-direction: row;
    flex-wrap: nowrap;
  }
  
  .modal-image.left {
    width: 50%;
    height: auto;
    min-height: 200px;
  }
  
  .modal-right {
    width: 50%;
    height: auto;
  }
  
  .modal-image.top {
    height: auto;
    min-height: 150px;
  }
  
  .modal-image.top img {
    height: auto;
    max-height: 200px;
  }
}
@media (max-width: 640px) {
  .gallery {
    column-count: 2;
  }
}

/* 弹窗模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #0A0E17;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    padding-left: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    margin-right: 20px;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #2a2a2a;
}

/* 新的画廊布局 */
.modal-gallery {
    display: flex;
    gap: 20px; /* 添加左右间距 */
    padding: 20px;
    /* 移除固定高度和最小高度设置，让内容自然流动 */
}

/* 添加基础的modal-image样式 */
.modal-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px; /* 添加边框圆角 */
}

.modal-image.left {
    flex: 1;
    width: 60%;
    height: auto; /* 恢复为自动高度，根据内容自适应 */
    min-height: 300px; /* 设置最小高度，确保有足够的显示空间 */
}

.modal-image.left img,
.modal-image.left video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.modal-right {
    width: 40%;
    height: 100%; /* 恢复为自动高度 */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-image.top {
    height: 100%; /* 恢复为自动高度 */
    border-radius: 8px;
    /* 移除flex: 1和min-height: 0，让图片保持自然比例 */
}

.modal-image.top img {
    width: 100%;
    height: 100%; /* 恢复为自动高度，保持图片比例 */
    max-height: 600px; /* 设置最大高度，避免图片过高 */
    object-fit: cover;
    border-radius: 8px;
}

/* 弹窗底部按钮样式 */
.modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    height: auto;
    border-top: none;
    border-radius: 0;
    flex-shrink: 0;
    gap: 10px;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 0%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-text {
    padding: 10px 25px;
    background-color: #f0eded;
    color: #000000;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    opacity: 0.5; /* 设置透明度为50% */
}

.upload-text:hover {
    background-color: #c2bcbd;
}

.cost-info {
    color: #cccccc;
    font-size: 14px;
}

.generate-btn {
    padding: 10px 25px;
    background-color: #f0eded;
    color: #000000;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.generate-btn:hover {
    background-color: #c2bcbd;
}

/* 剩余次数显示样式 */
.remaining-count {
    color: #ffffff; /* 使用显眼的红色 */
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

/* 重要通知弹窗样式 */
.important-notice {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.notice-content {
    background-color: #0A0E17;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.notice-content h2 {
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background-color: #1a1d26;
    border-radius: 8px;
    margin-bottom: 15px;
}

.notice-icon {
    font-size: 20px;
    margin-top: 2px;
}

.notice-item span:last-child {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.5;
}

.notice-footer {
    color: #666666;
    font-size: 12px;
    text-align: center;
    margin: 20px 0;
    line-height: 1.5;
}

.notice-footer a {
    color: #999999;
    text-decoration: underline;
}

.notice-footer a:hover {
    color: #ffffff;
}

.notice-continue {
    width: 100%;
    padding: 12px;
    background-color: #ffffff;
    color: #0a0a0a;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.notice-continue:hover {
    background-color: #cccccc;
}