/* ================= 全局变量与重置 ================= */
:root {
  --bg-color: #0b0c10;
  --card-bg: rgba(25, 25, 28, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-white: #ffffff;
  --text-gray: #888888;
  --text-gray-light: #aaaaaa;

  /* 设计图配色 */
  --accent-blue: #45a29e;
  --accent-green: #66fcf1;
  --accent-yellow: #f1c40f;
  --accent-red: #e74c3c;
  --accent-orange: #e67e22;
  --accent-gold: #c5a059;

  /* 字体栈 */
  --font-main: 'DengXian', 'Microsoft YaHei', sans-serif;
  --font-serif: 'SimSun', 'Songti SC', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-white);
  font-family: var(--font-main);
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
}

/* 通用容器（核心排版控制） */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* 字体与通用工具 */
.font-serif {
  font-family: var(--font-serif);
}

.text-12 {
  font-size: 12px;
}

.text-14 {
  font-size: 14px;
}

.text-16 {
  font-size: 16px;
}

.text-18 {
  font-size: 18px;
}

.text-28 {
  font-size: 28px;
}

.bold {
  font-weight: bold;
}

.text-white {
  color: var(--text-white);
}

.text-gray-light {
  color: var(--text-gray-light);
}

.icon-xs {
  width: 14px;
  height: 14px;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

/* ================= 统一头部 ================= */
.header-unified-bg {
  position: relative;
  width: 100%;
  background: url('./社区板及素材块/第一部分/星空背景.png') no-repeat center center/cover;
  padding-bottom: 60px;
  margin-bottom: 40px;
}

.header-unified-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), var(--bg-color));
  backdrop-filter: blur(3px);
  z-index: 1;
}

.header-unified-bg .navbar,
.header-unified-bg .container {
  position: relative;
  z-index: 2;
}

/* 导航栏 */
.navbar {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: relative;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(69, 162, 158, 0.5), transparent);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.nav-back:hover {
  opacity: 0.7;
}

.nav-center-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.title-cn {
  font-size: 18px;
  letter-spacing: 3px;
}

.title-en {
  font-size: 10px;
  color: var(--accent-blue);
  letter-spacing: 2px;
  margin-top: 4px;
  opacity: 0.8;
}

/* Hero 区域 */
.hero-section {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-subtitle {
  color: var(--accent-green);
  margin-top: 10px;
  font-weight: 300;
  letter-spacing: 1px;
}

/* ================= 功能卡片区 ================= */
.func-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.func-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(10px);
}

.func-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 20px;
}

.icon-box img {
  max-width: 24px;
  max-height: 24px;
}

/* 卡片主题色 */
.theme-yellow .icon-box {
  background: rgba(241, 196, 15, 0.15);
  color: var(--accent-yellow);
}

.theme-green .icon-box {
  background: rgba(102, 252, 241, 0.15);
  color: var(--accent-green);
}

.theme-red .icon-box {
  background: rgba(231, 76, 60, 0.15);
  color: var(--accent-red);
}

.theme-orange .icon-box {
  background: rgba(230, 126, 34, 0.15);
  color: var(--accent-orange);
}

.card-title {
  margin-bottom: 8px;
  font-size: 18px;
  color: #fff;
}

.card-desc {
  color: var(--text-gray);
  font-size: 13px;
  margin-bottom: 20px;
}

/* 按钮与链接 */
.btn-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
}

.btn-yellow {
  border: 1px solid rgba(241, 196, 15, 0.4);
  color: var(--accent-yellow);
}

.btn-yellow:hover {
  background: var(--accent-yellow);
  color: #000;
}

.btn-red {
  border: 1px solid rgba(231, 76, 60, 0.4);
  color: var(--accent-red);
}

.btn-red:hover {
  background: var(--accent-red);
  color: #fff;
}

.link-text {
  font-size: 14px;
  transition: 0.3s;
  display: inline-block;
}

.text-blue {
  color: var(--accent-blue);
}

.text-orange {
  color: var(--accent-orange);
}

.link-text:hover {
  transform: translateX(5px);
}

/* ================= 通用版块与排版 ================= */
.section-block {
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}

.section-block .bgg {
  position: absolute;
  z-index: -3;

  bottom: 0;

  left: 50%;
  transform: translateX(-50%);

  width: 100%;
  height: auto;

  pointer-events: none;

}

.section-header {
  margin-bottom: 30px;
  border-left: 4px solid var(--accent-gold);
  padding-left: 12px;
  line-height: 1.2;
}

/* 筛选与搜索条 */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 10px 20px;
  transition: all 0.3s;
}

.search-box:focus-within {
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 15px rgba(69, 162, 158, 0.2);
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  font-size: 14px;
  margin-left: 10px;
}

.search-icon-img {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.filter-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: #aaa;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 20px;
  padding: 6px 20px;
  font-size: 14px;
}

.filter-tag:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-tag.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(69, 162, 158, 0.3);
}

/* ================= 作品网格 ================= */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.work-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.work-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

/* 关键修复：图片比例锁定，摒弃死板的高度 */
.work-img-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* 黄金比例 */
  background: #111;
}

.work-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.work-card:hover .work-img-wrapper img {
  transform: scale(1.08);
}

.work-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.work-tags span {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-gray-light);
  margin-right: 6px;
}

.work-title {
  margin: 12px 0 6px;
  color: #fff;
  font-size: 18px;
  letter-spacing: 1px;
}

.work-author {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 12px;
}

.work-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 悬浮删除按钮 */
.work-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.work-card:hover .work-delete-btn {
  opacity: 1;
  transform: translateY(0);
}

.work-delete-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

/* 分页器 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 50px 0;
}

.page-nav-text {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: 0.3s;
}

.page-nav-text:hover {
  color: #fff;
}

.page-num-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
  cursor: pointer;
  transition: 0.3s;
}

.page-num-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.page-num-btn.active {
  background: var(--accent-blue);
  color: #000;
  font-weight: bold;
}

/* ================= 拍照大模块 ================= */
.upload-section-bg {
  position: relative;
  padding: 80px 20px;
  border-radius: 24px;
  background: url('./素材补充/背后.png') no-repeat center/cover;
  margin: 60px 0;
  text-align: center;
  overflow: hidden;
}

.upload-section-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  /* background: rgba(0, 0, 0, 0.7); */
  /* background: rgba(47, 47, 47, 0.7); */
  backdrop-filter: blur(2px);
}

.upload-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(15px);
  padding: 50px 30px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-deco {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.upload-btns {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn-upload-lg {
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 8px;
  font-weight: bold;
  border: none;
  background: linear-gradient(135deg, #e4cd8b, #c5a059);
  color: #000;
  cursor: pointer;
  transition: 0.3s;
}

.btn-upload-lg:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.4);
}

.btn-upload-outline {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-upload-outline:hover {
  background: var(--accent-gold);
  color: #000;
}

/* ================= Footer ================= */
.footer-section {
  text-align: center;
  padding: 80px 20px;
  margin-top: 80px;
  background: #0b0c10 url('./社区板及素材块/末页/底部装饰.png') no-repeat center/cover;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-sub {
  letter-spacing: 6px;
  color: #666;
  margin-bottom: 20px;
}

.footer-slogan {
  background: linear-gradient(to right, #fff, var(--accent-gold));
  background-clip: text;
  color: transparent;
  margin-bottom: 50px;
}

.footer-stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  flex-wrap: wrap;
}

.f-num {
  font-size: 40px;
  color: #ddd;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.f-label {
  color: var(--accent-gold);
  font-size: 14px;
  letter-spacing: 1px;
}

/* ================= 弹窗 ================= */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.custom-modal {
  background: #141416;
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-gold-modal {
  border-top: 4px solid var(--accent-gold);
}

.theme-red-modal {
  border-top: 4px solid var(--accent-red);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: bold;
}

.close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: 0.3s;
}

.close-btn:hover {
  background: var(--accent-red);
  color: #fff;
}

.upload-dashed-area {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  background: rgba(255, 255, 255, 0.02);
}

.theme-gold-modal .upload-dashed-area:hover {
  border-color: var(--accent-gold);
  background: rgba(197, 160, 89, 0.05);
}

.category-selection {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.category-btn {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  transition: 0.3s;
  font-size: 14px;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.category-btn.active {
  background: #fff;
  color: #000;
  font-weight: bold;
}

.theme-gold-modal .category-btn.active {
  background: var(--accent-gold);
}

.modal-naming-area {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

.modal-naming-area input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 14px;
}

.modal-naming-area input:focus {
  border-color: var(--accent-gold);
}

.confirm-name-btn {
  padding: 0 24px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  background: var(--accent-gold);
  color: #000;
  transition: 0.3s;
}

/* 游客模式美化提示 */
.guest-beautiful-prompt {
  grid-column: 1 / -1;
  background: rgba(197, 160, 89, 0.05);
  border: 1px dashed rgba(197, 160, 89, 0.4);
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  backdrop-filter: blur(5px);
}

.guest-prompt-title {
  color: var(--accent-gold);
  font-size: 22px;
  margin: 16px 0 10px;
}


/* ================= 响应式调整 (Mobile & Tablet) ================= */
@media (max-width: 1024px) {
  .func-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .works-grid,
  #myWorksGrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {

  .works-grid,
  #myWorksGrid {
    grid-template-columns: 1fr !important;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
    margin-bottom: 10px;
  }

  .footer-stats {
    gap: 30px;
    flex-direction: column;
  }

  .upload-btns {
    flex-direction: column;
  }

  .btn-upload-lg {
    width: 100%;
  }
}

.like-btn {
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.like-btn .heart-icon {
  transition: transform 0.2s ease;
}

.like-btn.liked .heart-icon {
  filter: saturate(1.2);
}

.like-btn.like-pop .heart-icon {
  transform: scale(1.25);
}

.image-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  box-sizing: border-box;
}

.image-preview-box {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: rgba(20, 20, 20, 0.96);
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.image-preview-box img {
  max-width: 80vw;
  max-height: 75vh;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.image-preview-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 30px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}

.image-preview-close:hover {
  opacity: 0.8;
}

.image-preview-title {
  margin-top: 12px;
  color: #f5f5f5;
  font-size: 16px;
  letter-spacing: 1px;
}