// 横向折叠面板样式 - 优化为看板风格
.horizontal-process-tabs {
  display: flex;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(64, 158, 255, 0.1);

  .process-tab {
    flex: 1;
    padding: 14px 18px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #666;
    position: relative;
    background: transparent;

    &:hover {
      background: rgba(64, 158, 255, 0.08);
      color: #409eff;
      transform: translateY(-1px);
    }

    &.active {
      background: linear-gradient(135deg, #409eff 0%, #5ac8fa 100%);
      color: white;
      box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
      transform: translateY(-2px);
    }

    .process-name {
      font-size: 15px;
      margin-bottom: 4px;
      font-weight: 600;
    }

    .process-status {
      font-size: 12px;
      opacity: 0.9;
    }
  }
}

// 空间列表容器样式 - 看板风格优化
.space-list-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid rgba(64, 158, 255, 0.1);

  .space-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid rgba(64, 158, 255, 0.1);

    .header-title {
      font-size: 18px;
      font-weight: 700;
      color: #333;
      display: flex;
      align-items: center;
      gap: 8px;

      &::before {
        content: "📋";
        font-size: 16px;
      }
    }

    .add-space-btn {
      padding: 8px 16px;
      background: linear-gradient(135deg, #409eff 0%, #5ac8fa 100%);
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      transition: all 0.3s ease;
      box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);

      &:hover {
        background: linear-gradient(135deg, #337ecc 0%, #4a9eff 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
      }

      &:active {
        transform: translateY(0);
      }
    }
  }

  .add-space-input {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;

    input {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid #ddd;
      border-radius: 4px;
      font-size: 14px;

      &:focus {
        outline: none;
        border-color: #409eff;
      }
    }

    .btn-group {
      display: flex;
      gap: 8px;

      button {
        padding: 8px 12px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.3s ease;

        &.confirm-btn {
          background: #67c23a;
          color: white;

          &:hover {
            background: #5daf34;
          }
        }

        &.cancel-btn {
          background: #f56c6c;
          color: white;

          &:hover {
            background: #dd6161;
          }
        }
      }
    }
  }

  // 空间列表样式 - 看板卡片布局
  .space-list {
    padding: 16px 24px 24px;
    background: #fafbfc;

    .space-item {
      background: white;
      border: 2px solid rgba(64, 158, 255, 0.1);
      border-radius: 12px;
      margin-bottom: 16px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
      overflow: hidden;

      &:hover {
        border-color: rgba(64, 158, 255, 0.3);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
      }

      &.expanded {
        border-color: #409eff;
        box-shadow: 0 8px 32px rgba(64, 158, 255, 0.2);
      }

      .space-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 24px;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        border-bottom: 1px solid rgba(64, 158, 255, 0.08);
        cursor: pointer;

        .space-info {
          display: flex;
          align-items: center;
          gap: 16px;
          flex: 1;

          .space-name {
            font-size: 16px;
            font-weight: 700;
            color: #333;
            margin: 0;
          }

          .space-status {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;

            &.pending {
              background: linear-gradient(135deg, #fef3cd 0%, #fff3cd 100%);
              color: #856404;
              border: 1px solid #ffeaa7;
            }

            &.in-progress {
              background: linear-gradient(135deg, #cce5ff 0%, #e3f2fd 100%);
              color: #0d47a1;
              border: 1px solid #90caf9;
            }

            &.completed {
              background: linear-gradient(135deg, #d4edda 0%, #d1ecf1 100%);
              color: #155724;
              border: 1px solid #a3d977;
            }

            &.approved {
              background: linear-gradient(135deg, #e2e3e5 0%, #f8f9fa 100%);
              color: #383d41;
              border: 1px solid #ced4da;
            }
          }

          .space-progress {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: #666;
            font-weight: 500;

            .progress-bar {
              width: 80px;
              height: 6px;
              background: #e9ecef;
              border-radius: 3px;
              overflow: hidden;

              .progress-fill {
                height: 100%;
                background: linear-gradient(90deg, #409eff 0%, #5ac8fa 100%);
                border-radius: 3px;
                transition: width 0.3s ease;
              }
            }
          }
        }

        .space-actions {
          display: flex;
          align-items: center;
          gap: 12px;

          .delete-btn {
            padding: 6px 8px;
            background: transparent;
            border: 1px solid #dc3545;
            color: #dc3545;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s ease;

            &:hover {
              background: #dc3545;
              color: white;
              transform: scale(1.05);
            }
          }

          .expand-icon {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(64, 158, 255, 0.1);
            border-radius: 50%;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;

            &:hover {
              background: rgba(64, 158, 255, 0.2);
              transform: scale(1.1);
            }

            &.expanded {
              background: #409eff;
              color: white;
              transform: rotate(180deg);
            }

            i {
              font-size: 12px;
              transition: transform 0.3s ease;
            }
          }
        }
      }

      .space-content {
        background: #ffffff;
        border-top: 1px solid rgba(64, 158, 255, 0.08);
        padding: 0;
        display: none;

        &.expanded {
          display: block;
          animation: slideDown 0.3s ease-out;
        }

        .content-section {
          padding: 24px;
          border-bottom: 1px solid rgba(64, 158, 255, 0.05);

          &:last-child {
            border-bottom: none;
          }

          .section-title {
            font-size: 14px;
            font-weight: 700;
            color: #333;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;

            &::before {
              content: "";
              width: 4px;
              height: 16px;
              background: linear-gradient(135deg, #409eff 0%, #5ac8fa 100%);
              border-radius: 2px;
            }
          }

          .image-upload-area {
            border: 2px dashed rgba(64, 158, 255, 0.3);
            border-radius: 12px;
            padding: 32px;
            text-align: center;
            background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            position: relative;
            overflow: hidden;

            &::before {
              content: "";
              position: absolute;
              top: 0;
              left: -100%;
              width: 100%;
              height: 100%;
              background: linear-gradient(90deg, transparent, rgba(64, 158, 255, 0.1), transparent);
              transition: left 0.5s ease;
            }

            &:hover {
              border-color: #409eff;
              background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
              transform: translateY(-2px);
              box-shadow: 0 8px 24px rgba(64, 158, 255, 0.15);

              &::before {
                left: 100%;
              }

              .upload-icon {
                transform: scale(1.1);
                color: #409eff;
              }

              .upload-text {
                color: #409eff;
              }
            }

            .upload-icon {
              font-size: 48px;
              color: #ccc;
              margin-bottom: 16px;
              transition: all 0.3s ease;
            }

            .upload-text {
              font-size: 16px;
              color: #666;
              font-weight: 500;
              transition: color 0.3s ease;
            }

            .upload-hint {
              font-size: 12px;
              color: #999;
              margin-top: 8px;
            }
          }

          .image-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 16px;
            margin-top: 20px;

            .image-item {
              position: relative;
              border-radius: 12px;
              overflow: hidden;
              box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
              transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
              background: white;

              &:hover {
                transform: translateY(-4px);
                box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

                .image-overlay {
                  opacity: 1;
                }
              }

              img {
                width: 100%;
                height: 120px;
                object-fit: cover;
                border-radius: 12px;
              }

              .image-overlay {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(64, 158, 255, 0.8) 100%);
                display: flex;
                align-items: center;
                justify-content: center;
                opacity: 0;
                transition: opacity 0.3s ease;
                border-radius: 12px;

                .image-actions {
                  display: flex;
                  gap: 12px;

                  button {
                    padding: 8px 12px;
                    border: none;
                    border-radius: 6px;
                    cursor: pointer;
                    font-size: 12px;
                    font-weight: 600;
                    transition: all 0.3s ease;

                    &.preview-btn {
                      background: rgba(255, 255, 255, 0.9);
                      color: #333;

                      &:hover {
                        background: white;
                        transform: scale(1.05);
                      }
                    }

                    &.delete-btn {
                      background: rgba(220, 53, 69, 0.9);
                      color: white;

                      &:hover {
                        background: #dc3545;
                        transform: scale(1.05);
                      }
                    }
                  }
                }
              }
            }
          }

          .readonly-images {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 12px;

            .readonly-image-item {
              position: relative;
              border-radius: 8px;
              overflow: hidden;
              box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

              img {
                width: 100%;
                height: 100px;
                object-fit: cover;
              }
            }
          }

          .progress-bar {
            width: 100%;
            height: 6px;
            background: #f0f0f0;
            border-radius: 3px;
            overflow: hidden;

            .progress-fill {
              height: 100%;
              background: linear-gradient(90deg, #409eff, #67c23a);
              transition: width 0.3s ease;
            }
          }

          .notes-input {
            width: 100%;
            min-height: 100px;
            padding: 16px;
            border: 2px solid rgba(64, 158, 255, 0.1);
            border-radius: 12px;
            font-size: 14px;
            line-height: 1.6;
            resize: vertical;
            transition: all 0.3s ease;
            background: #fafbfc;

            &:focus {
              outline: none;
              border-color: #409eff;
              background: white;
              box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
            }

            &::placeholder {
              color: #999;
              font-style: italic;
            }
          }

          .readonly-notes {
            padding: 16px;
            background: #f8f9fa;
            border-radius: 12px;
            border-left: 4px solid #409eff;
            font-size: 14px;
            line-height: 1.6;
            color: #555;
            min-height: 60px;

            &:empty::before {
              content: "暂无备注";
              color: #999;
              font-style: italic;
            }
          }
        }
      }
    }
  }

  // 空间卡片样式 - 类似看板卡片效果
  .space-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }

  .space-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;

    &:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      border-color: #409eff;
    }

    &.expanded {
      border-color: #409eff;
      box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
    }

    .space-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      background: #f8f9fa;
      border-bottom: 1px solid #e9ecef;
      cursor: pointer;
      transition: all 0.3s ease;

      &:hover {
        background: #e9ecef;
      }

      .space-info {
        display: flex;
        align-items: center;
        gap: 12px;

        .space-name {
          font-size: 14px;
          font-weight: 600;
          color: #333;
        }

        .space-progress {
          font-size: 12px;
          color: #666;
          background: #e9ecef;
          padding: 2px 8px;
          border-radius: 12px;
        }
      }

      .space-actions {
        display: flex;
        align-items: center;
        gap: 8px;

        .delete-space-btn {
          padding: 4px 6px;
          background: transparent;
          color: #dc3545;
          border: none;
          border-radius: 4px;
          cursor: pointer;
          transition: all 0.3s ease;
          display: flex;
          align-items: center;
          justify-content: center;

          &:hover {
            background: rgba(220, 53, 69, 0.1);
            color: #c82333;
          }

          svg {
            width: 14px;
            height: 14px;
          }
        }

        .expand-arrow {
          font-size: 12px;
          color: #666;
          transition: transform 0.3s ease;
          margin-left: 8px;

          &.expanded {
            transform: rotate(180deg);
          }
        }
      }
    }

    .space-content {
      padding: 20px;
      background: white;
      display: none;

      .upload-section {
        margin-bottom: 20px;

        .upload-dropzone {
          border: 2px dashed #d9d9d9;
          border-radius: 8px;
          padding: 20px;
          text-align: center;
          cursor: pointer;
          transition: all 0.3s ease;
          background: #fafafa;

          &:hover, &.drag-over {
            border-color: #409eff;
            background: rgba(64, 158, 255, 0.05);
          }

          .upload-placeholder {
            .upload-icon {
              font-size: 32px;
              color: #d9d9d9;
              margin-bottom: 12px;
            }

            .upload-text {
              font-size: 14px;
              color: #666;
              margin-bottom: 8px;
            }

            .upload-hint {
              font-size: 12px;
              color: #999;
            }
          }

          .uploaded-images-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            max-width: 300px;

            .uploaded-image-item {
              position: relative;
              border-radius: 6px;
              overflow: hidden;
              cursor: pointer;
              transition: transform 0.3s ease;

              &:hover {
                transform: scale(1.05);

                .image-overlay {
                  opacity: 1;
                }
              }

              img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                aspect-ratio: 1;
              }

              .image-overlay {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.7);
                opacity: 0;
                transition: opacity 0.3s ease;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                padding: 8px;

                .image-name {
                  color: white;
                  font-size: 12px;
                  font-weight: 500;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                }

                .image-actions {
                  display: flex;
                  gap: 4px;
                  justify-content: center;

                  button {
                    width: 24px;
                    height: 24px;
                    border: none;
                    border-radius: 4px;
                    background: rgba(255, 255, 255, 0.9);
                    color: #333;
                    cursor: pointer;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    transition: all 0.2s ease;

                    &:hover {
                      background: white;
                    }

                    &.preview-btn:hover {
                      color: #409eff;
                    }

                    &.delete-btn:hover {
                      color: #dc3545;
                    }

                    svg {
                      width: 12px;
                      height: 12px;
                    }
                  }
                }
              }
            }
          }
        }

        .readonly-images {
          .uploaded-images-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            max-width: 300px;

            .uploaded-image-item {
              position: relative;
              border-radius: 6px;
              overflow: hidden;
              cursor: pointer;

              img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                aspect-ratio: 1;
              }

              .image-overlay {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.7);
                opacity: 0;
                transition: opacity 0.3s ease;
                display: flex;
                align-items: flex-end;
                padding: 8px;

                &:hover {
                  opacity: 1;
                }

                .image-name {
                  color: white;
                  font-size: 12px;
                  font-weight: 500;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                }
              }
            }
            
            // 添加更多图片按钮
            .add-more-images-btn {
              aspect-ratio: 1;
              border: 2px dashed #d1d5db;
              border-radius: 6px;
              display: flex;
              flex-direction: column;
              align-items: center;
              justify-content: center;
              cursor: pointer;
              transition: all 0.3s ease;
              background: #f9fafb;
              
              &:hover {
                border-color: #3b82f6;
                background: #eff6ff;
                transform: scale(1.05);
              }
              
              .add-icon {
                font-size: 20px;
                font-weight: bold;
                color: #6b7280;
                margin-bottom: 4px;
              }
              
              .add-text {
                font-size: 10px;
                color: #6b7280;
                font-weight: 500;
              }
              
              &:hover .add-icon,
              &:hover .add-text {
                color: #3b82f6;
              }
            }
          }

          .empty-tip {
            text-align: center;
            color: #999;
            font-size: 14px;
            padding: 40px 20px;
          }
        }
      }

      .notes-section {
        .notes-label {
          display: block;
          font-size: 14px;
          font-weight: 500;
          color: #333;
          margin-bottom: 8px;
        }

        .notes-textarea {
          width: 100%;
          min-height: 80px;
          padding: 12px;
          border: 1px solid #ddd;
          border-radius: 6px;
          font-size: 14px;
          resize: vertical;
          transition: border-color 0.3s ease;

          &:focus {
            outline: none;
            border-color: #409eff;
            box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
          }

          &::placeholder {
            color: #999;
          }
        }

        .notes-readonly {
          padding: 12px;
          background: #f8f9fa;
          border: 1px solid #e9ecef;
          border-radius: 6px;
          font-size: 14px;
          color: #666;
          min-height: 80px;
        }
      }
    }

    // 展开状态下显示内容
    &.expanded .space-content {
      display: block;
    }
  }

  // 添加空间输入容器样式
  .add-space-input-container {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
    border-top: 2px solid rgba(64, 158, 255, 0.1);

    .input-group {
      display: flex;
      gap: 12px;
      align-items: center;

      .space-name-input {
        flex: 1;
        padding: 12px 16px;
        border: 2px solid rgba(64, 158, 255, 0.2);
        border-radius: 8px;
        font-size: 14px;
        transition: all 0.3s ease;
        background: white;

        &:focus {
          outline: none;
          border-color: #409eff;
          box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
        }

        &::placeholder {
          color: #999;
        }
      }

      .action-buttons {
        display: flex;
        gap: 8px;

        .confirm-btn, .cancel-btn {
          padding: 10px 16px;
          border: none;
          border-radius: 6px;
          cursor: pointer;
          font-size: 13px;
          font-weight: 600;
          transition: all 0.3s ease;

          &:hover {
            transform: translateY(-1px);
          }
        }

        .confirm-btn {
          background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
          color: white;
          box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);

          &:hover {
            background: linear-gradient(135deg, #389e0d 0%, #52c41a 100%);
            box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
          }
        }

        .cancel-btn {
          background: #f5f5f5;
          color: #666;
          border: 1px solid #d9d9d9;

          &:hover {
            background: #e6e6e6;
            color: #333;
          }
        }
      }
    }
  }
}



// 动画效果
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .horizontal-process-tabs {
    flex-direction: column;
    gap: 8px;

    .process-tab {
      text-align: left;
      padding: 12px 16px;
    }
  }

  .space-list-container {
    .space-list {
      padding: 12px 16px 16px;

      .space-item {
        .space-header {
          padding: 16px;
          flex-direction: column;
          align-items: flex-start;
          gap: 12px;

          .space-info {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
            width: 100%;
          }

          .space-actions {
            align-self: flex-end;
          }
        }

        .space-content {
          .content-section {
            padding: 16px;

            .image-list {
              grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
              gap: 12px;

              .image-item img {
                height: 80px;
              }
            }
          }
        }
      }
    }
  }

  .add-space-input-container {
    padding: 16px;

    .input-group {
      flex-direction: column;
      align-items: stretch;

      .action-buttons {
        justify-content: flex-end;
      }
    }
  }
}