  html,
  body {
      height: 100%;
  }

  .main-container {
      height: 100%;
      overflow-y: auto;
      background-color: var(--page);
      box-sizing: border-box;
      padding-top: 80px;
  }

  .main-container::-webkit-scrollbar {
      width: 6px;
  }

  .main-container::-webkit-scrollbar-track {
      background-color: var(--page);
  }

  .main-container::-webkit-scrollbar-thumb {
      background-color: #d4cfc8;
      border-radius: 3px;
  }

  .main-container::-webkit-scrollbar-thumb:hover {
      background-color: #c4bfb8;
  }

  .my-project {
      height: 100%;
      display: flex;
      flex-direction: column;
      background-color: var(--page);
      color: #333;
      padding: clamp(54px, 6.2vw, 100px) var(--page-pad);
  }

  .project-content {
      display: flex;
      flex-direction: column;
      height: 100%;
      background-color: var(--page);
      position: relative;
      box-sizing: border-box;
  }

  /* ===== 顶部栏 ===== */
  .top-bar {
      display: flex;
      align-items: center;
      padding: 20px 0 60px;
      box-sizing: border-box;
      flex-shrink: 0;
      gap: 80px;
  }

  .search-input-wrapper {
      position: relative;
      width: 365px;
      min-width: 100px;
      height: 40px;
  }

  .search-input-wrapper input {
      width: 100%;
      height: 100%;
      padding: 0 40px 0 40px;
      border: 1px solid #6b6b6b;
      border-radius: 25px;
      background-color: transparent;
      font-size: 14px;
      outline: none;
      color: #333;
  }

  .search-input-wrapper input::placeholder {
      color: #999;
  }

  .search-input-wrapper .search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 20px;
      height: 20px;
      color: #333;
      pointer-events: none;
  }

  .search-input-wrapper .clear-icon {
      position: absolute;
      right: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 16px;
      height: 16px;
      cursor: pointer;
      color: #999;
      display: none;
  }

  .search-input-wrapper .clear-icon.visible {
      display: block;
  }

  .nav-buttons {
      display: flex;
      gap: 20px;
  }

  .nav-btn {
      padding: 8px 16px;
      border: 1px solid #d2d2d2;
      border-radius: 20px;
      font-size: 14px;
      background: transparent;
      color: #6b6b6b;
      cursor: pointer;
      transition: all 0.25s;
      font-weight: 500;
  }

  .nav-btn:hover {
      background: #e8e4de;
  }

  .nav-btn.active {
      background: #ded7cf !important;
      border-color: #ded7cf !important;
      color: #333 !important;
  }

  /* ===== 项目列表容器 ===== */
  .project-container {
      width: 100%;
      flex: 1;
      padding: 0 0 30px;
      display: flex;
      flex-wrap: wrap;
      align-content: flex-start;
      justify-content: flex-start;
      gap: 20px;
      box-sizing: border-box;
  }

  /* ===== 关键修复：让 projectList 的子元素直接参与 flex 布局 ===== */
  #projectList,
  #homeProjectList {
      display: contents;
  }

  /* ===== 项目卡片 ===== */
  .project-item {
      width: calc(33.33% - 13.33px);
      max-height: 400px;
      border-radius: 30px;
      background: #fff;
      overflow: hidden;
      position: relative;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      cursor: pointer;
      transition:
          transform 0.3s,
          box-shadow 0.3s;
  }

  .project-item:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  /* 新建项目卡片 */
  .create-project {
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #fafafa;
      cursor: pointer;
      min-height: 300px;
  }

  .create-project-content {
      text-align: center;
  }

  .plus-icon {
      width: 55px;
      height: 55px;
      margin-bottom: 10px;
      display: block;
      margin-left: auto;
      margin-right: auto;
  }

  .create-text {
      color: #666;
      font-size: 20px;
  }

  /* 图片区域 */
  .project-img {
      width: 100%;
      height: 85%;
      position: relative;
      overflow: hidden;
      background: #e8e4de;
  }

  .project-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s;
  }

  .project-item:hover .project-img img {
      transform: scale(1.05);
  }

  .project-img-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.3s ease;
      pointer-events: none;
  }

  .project-img:hover .project-img-overlay {
      opacity: 1;
      pointer-events: auto;
  }

  /* 删除按钮：定位在 .project-img 右上角，hover 卡片时淡入；
           不依赖 .project-img-overlay 的 hover 状态，确保可见 */
  .delete-icon {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 36px;
      height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      border: 0;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.55);
      color: #fff;
      cursor: pointer;
      z-index: 5;
      opacity: 0;
      transform: translateY(-4px);
      transition:
          opacity 0.22s ease,
          transform 0.22s ease,
          background 0.18s ease;
  }

  /* hover 图片区域时显示（与图片上的其他 overlay 行为一致） */
  .project-img:hover .delete-icon,
  .delete-icon:focus-visible {
      opacity: 1;
      transform: translateY(0);
  }

  .delete-icon:hover {
      background: rgba(220, 53, 69, 0.95);
      transform: scale(1.06);
  }

  .delete-icon img {
      width: 20px;
      height: 20px;
      display: block;
      pointer-events: none;
      filter: brightness(0) invert(1);
  }

  .enter-canvas-btn {
      color: #fff;
      font-size: 22px;
      font-weight: bold;
      cursor: pointer;
      text-align: center;
      padding: 12px 24px;
  }

  .enter-canvas-btn:hover {
      transform: translateY(2px);
  }

  .project-info {
      padding: 20px;
  }

  .project-name {
      font-size: 14px;
      font-weight: 500;
      color: #333;
      margin-bottom: 6px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: flex;
      align-items: center;
      gap: 6px;
      font-family: Inter;
  }

  .project-name span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
  }

  .project-name-date {
      display: flex;
      justify-content: space-between;
      align-items: center;
  }

  .project-date {
      font-size: 14px;
      font-weight: 500;
      color: #414141;
      font-family: Inter;
  }

  .action-btn {
      width: 85px;
      height: 30px;
      line-height: 30px;
      border-radius: 20px;
      font-size: 14px;
      font-family: Inter;
      color: #000;
      cursor: pointer;
      background: #ded7cf;
      text-align: center;
      transition: background 0.25s;
  }

  .action-btn:hover {
      background: #cec5bb;
  }

  /* ===== 加载更多/没有更多/加载错误 ===== */
  /* 关键：让 .load-more-container 在 flex 容器中占满整行 */
  .load-more-container {
      /* flex 子项占满整行（项目容器是 flex-wrap: wrap） */
      flex: 0 0 100%;
      width: 100%;
      /* 紧跟最后一张卡片，避免被挤到一行/一列 */
      align-self: stretch;
      /* 文字居中 */
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 28px 0 8px 0;
      color: #6b6b6b;
      font-size: 14px;
      text-align: center;
      /* 不让卡片 hover 蒙层覆盖到 */
      position: relative;
      z-index: 1;
  }

  .load-more-spinner {
      display: inline-block;
      width: 14px;
      height: 14px;
      border: 2px solid #d4cfc8;
      border-top-color: #6b6b6b;
      border-radius: 50%;
      animation: load-more-spin 0.8s linear infinite;
  }

  @keyframes load-more-spin {
      to {
          transform: rotate(360deg);
      }
  }

  .load-more-container.load-more--nomore {
      font-size: 14px;
      color: #999;
  }

  /* "显示更多" 按钮 */
  .load-more-btn {
      font-size: 14px;
      color: #999;
      cursor: pointer;
  }

  .load-more-btn img {
      width: 14px;
      height: 14px;
      transform: rotate(180deg);
  }

  /* ===== 响应式 ===== */
  @media (min-width: 2000px) {
      .project-item {
          min-height: 600px;
          width: calc(20% - 16px);
      }
  }

  @media (min-width: 1500px) and (max-width: 1999px) {
      .project-item {
          min-height: 500px;
          width: calc(20% - 16px);
      }
  }

  @media (min-width: 1200px) and (max-width: 1499px) {
      .project-item {
          width: calc(25% - 15px);
      }
  }

  @media (min-width: 992px) and (max-width: 1199px) {
      .project-item {
          width: calc(33.33% - 13.33px);
      }
  }

  @media (min-width: 768px) and (max-width: 991px) {
      .project-item {
          width: calc(50% - 10px);
      }

      .top-bar {
          padding: 20px 0;
      }

      .project-container {
          padding: 0 0 30px;
      }
  }

  @media (max-width: 767px) {
      .main-container {
          padding-top: 120px;
      }

      .project-item {
          width: 100%;
      }

      .top-bar {
          flex-wrap: wrap;
          gap: 12px;
          padding: 16px 0;
      }

      .search-input-wrapper {
          width: 200px !important;
          min-width: 120px;
          height: 34px;
      }

      .project-container {
          padding: 0 0 30px;
      }
  }

  /* 回到顶部 */
  .back-to-top {
      position: fixed;
      bottom: 40px;
      right: 40px;
      width: 36px;
      height: 36px;
      border-radius: 18px;
      background: #ded7cf;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      transition:
          opacity 0.3s,
          transform 0.3s;
      opacity: 0;
      pointer-events: none;
      z-index: 999;
  }

  .back-to-top.show {
      opacity: 1;
      pointer-events: auto;
  }

  .back-to-top:hover {
      background: #cec5bb;
  }

  .back-to-top svg {
      fill: #333;
  }